Click here to Skip to main content
14,980,591 members
Home / Discussions / C#
   

C#

 
GeneralRe: Shared memory Pin
manoharbalu21-Jun-21 1:15
Membermanoharbalu21-Jun-21 1:15 
AnswerRe: Shared memory Pin
Richard Deeming20-Jun-21 23:18
mveRichard Deeming20-Jun-21 23:18 
QuestionRegarding Use of System.Text.JSON in .NetFramework 4.7.2 Pin
Member 1522917418-Jun-21 1:11
MemberMember 1522917418-Jun-21 1:11 
AnswerRe: Regarding Use of System.Text.JSON in .NetFramework 4.7.2 Pin
Dave Kreskowiak18-Jun-21 5:00
mveDave Kreskowiak18-Jun-21 5:00 
GeneralRe: Regarding Use of System.Text.JSON in .NetFramework 4.7.2 Pin
Richard Deeming20-Jun-21 23:10
mveRichard Deeming20-Jun-21 23:10 
GeneralRe: Regarding Use of System.Text.JSON in .NetFramework 4.7.2 Pin
Dave Kreskowiak21-Jun-21 4:41
mveDave Kreskowiak21-Jun-21 4:41 
AnswerRe: Regarding Use of System.Text.JSON in .NetFramework 4.7.2 Pin
Richard Deeming20-Jun-21 23:16
mveRichard Deeming20-Jun-21 23:16 
QuestionHow to use web browser control to automate login to a site Pin
Mou_kol16-Jun-21 10:28
MemberMou_kol16-Jun-21 10:28 
I was trying to login to a site programmatically. i am loading site into web browser control. i tried this code but it did not worked. https://auth.accounts.dowjones.com/login

Sorry could not share actual credentials.
C#
HtmlElement username = null;
HtmlElement password = null;
HtmlElement submit = null;

foreach (HtmlElement divcontainer in webBrowser1.Document.GetElementsByTagName("div"))
{
    if (divcontainer.GetAttribute("className") == "text-input")
    {
        foreach (HtmlElement child in divcontainer.Children)
        {
            if (divcontainer.GetAttribute("className") == "js-email-input")
            {
                username = divcontainer;
            }

            if (divcontainer.GetAttribute("className") == "password js-password-input")
            {
                password = divcontainer;
            }
        }
    }

    if (divcontainer.GetAttribute("className") == "sign-in")
    {
        foreach (HtmlElement child in divcontainer.Children)
        {
            if (divcontainer.GetAttribute("className") == "solid-button basic-login-submit")
            {
                submit = divcontainer;
            }
        }
    }
}

if (username != null && password != null && submit != null)
{
    username.SetAttribute("value", "test@gmail.com");
    password.SetAttribute("value", "test11");
    submit.InvokeMember("click");
}


please some one guide me what to change in my code to automate login.
Thanks
AnswerRe: How to use web browser control to automate login to a site Pin
Christian Graus16-Jun-21 11:24
protectorChristian Graus16-Jun-21 11:24 
GeneralRe: How to use web browser control to automate login to a site Pin
Mou_kol16-Jun-21 21:05
MemberMou_kol16-Jun-21 21:05 
AnswerRe: How to use web browser control to automate login to a site Pin
Richard Deeming20-Jun-21 23:08
mveRichard Deeming20-Jun-21 23:08 
GeneralRe: How to use web browser control to automate login to a site Pin
Mou_kol21-Jun-21 4:19
MemberMou_kol21-Jun-21 4:19 
Questionimage processing Pin
elham mohammed16-Jun-21 5:53
Memberelham mohammed16-Jun-21 5:53 
AnswerRe: image processing Pin
Dave Kreskowiak16-Jun-21 5:54
mveDave Kreskowiak16-Jun-21 5:54 
AnswerRe: image processing Pin
OriginalGriff16-Jun-21 9:34
mveOriginalGriff16-Jun-21 9:34 
QuestionVisual Basic Commission Switch Statement + Calc Pin
Member 1524886715-Jun-21 11:46
MemberMember 1524886715-Jun-21 11:46 
AnswerRe: Visual Basic Commission Switch Statement + Calc Pin
Dave Kreskowiak15-Jun-21 17:44
mveDave Kreskowiak15-Jun-21 17:44 
AnswerRe: Visual Basic Commission Switch Statement + Calc Pin
Richard Deeming15-Jun-21 22:07
mveRichard Deeming15-Jun-21 22:07 
GeneralRe: Visual Basic Commission Switch Statement + Calc Pin
Member 1524886716-Jun-21 9:36
MemberMember 1524886716-Jun-21 9:36 
QuestionGet serial number from local printers connected to workstation by USB Pin
SzakiII15-Jun-21 2:28
MemberSzakiII15-Jun-21 2:28 
AnswerRe: Get serial number from local printers connected to workstation by USB Pin
Gerry Schmitz15-Jun-21 9:21
mveGerry Schmitz15-Jun-21 9:21 
AnswerRe: Get serial number from local printers connected to workstation by USB Pin
Randor 15-Jun-21 11:41
professional Randor 15-Jun-21 11:41 
GeneralRe: Get serial number from local printers connected to workstation by USB Pin
Gerry Schmitz15-Jun-21 13:13
mveGerry Schmitz15-Jun-21 13:13 
GeneralRe: Get serial number from local printers connected to workstation by USB Pin
Randor 15-Jun-21 14:06
professional Randor 15-Jun-21 14:06 
Questionhow to convert Character codes HTML to arabic using c# Pin
michael nabil14-Jun-21 8:30
Membermichael nabil14-Jun-21 8:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.