Click here to Skip to main content
15,077,137 members
Home / Discussions / C#
   

C#

 
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 
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 
Issue sorted. i have done the job this way and it worked.

C#
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    if (webBrowser1.ReadyState == WebBrowserReadyState.Complete && IsRedirect)
    {
        System.Threading.Thread.Sleep(5000);
        timer1.Enabled = true;
    }
    else if (webBrowser1.ReadyState == WebBrowserReadyState.Complete && IsloginPage)
    {
        mshtml.IHTMLDocument2 htmlDocument = (mshtml.IHTMLDocument2) webBrowser1.Document.DomDocument;
        mshtml.IHTMLElementCollection objforms = htmlDocument.forms;
        foreach (mshtml.HTMLFormElementClass form in objforms)
        {
            if (form.className == "form")
            {
                IHTMLElementCollection inputElements = form.getElementsByTagName("INPUT");
                foreach (HTMLInputElementClass inputElement in inputElements)
                {
                    if ((inputElement.type.Trim().ToLower() == "email") && (inputElement.name.Trim() == "email"))
                    {
                        inputElement.value = "Test_UID@gmail.com";
                    }
                    else if ((inputElement.type.Trim().ToLower() == "password") && (inputElement.name.Trim() == "password"))
                    {
                        inputElement.value = "Test_PWD";
                    }
                }
                IHTMLElementCollection inputElements1 = form.getElementsByTagName("BUTTON");

                foreach (HTMLButtonElementClass inputElement in inputElements1)
                {
                    if ((inputElement.innerText.ToLower() == "sign in") && (inputElement.type.Trim().ToLower() == "submit")
                        && (inputElement.tagName.Trim().ToLower() == "button"))
                    {
                        inputElement.click();
                        break;
                    }
                }
            }
        }
    }
}


Thanks
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 
AnswerRe: how to convert Character codes HTML to arabic using c# Pin
Richard Deeming14-Jun-21 22:02
mveRichard Deeming14-Jun-21 22:02 
GeneralRe: how to convert Character codes HTML to arabic using c# Pin
michael nabil15-Jun-21 3:00
Membermichael nabil15-Jun-21 3:00 
GeneralRe: how to convert Character codes HTML to arabic using c# Pin
Richard Deeming15-Jun-21 3:26
mveRichard Deeming15-Jun-21 3:26 
AnswerRe: how to convert Character codes HTML to arabic using c# Pin
Gerry Schmitz15-Jun-21 6:14
mveGerry Schmitz15-Jun-21 6:14 

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.