Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to develop an application in c# or C++. when we run the application it change website elements
HTMLDoc.all.UserName.type = "text"
to
HTMLDoc.all.UserName.type = "Password"
and close.

What I have tried:

I try to change elements on Excel VBA with follow code

VB
Dim MyBrowser As InternetExplorer
Sub Cigna()

Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://cignaforhcp.cigna.com/web/public/guest/"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.UserName.type = "Password"
HTMLDoc.all.UserName.Value = "00000"
HTMLDoc.all.Password.Value = "00000"
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub


It is working but i dont know how can i make an application on C#.
Posted
Updated 22-Aug-17 22:12pm
v2
Comments
j snooze 22-Aug-17 17:52pm    
google c# for beginners tutorials. or microsoft has a site with free educational videos at microsoftvirtualacademy.com. Lots of beginner videos there.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900