Click here to Skip to main content
15,891,993 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I convert this VB code into C# code?

VB
Set objExplorer = WScript.CreateObject("InternetExplorer.Application", "IE_")
objExplorer.Navigate "http://www.codeguru.com/login.php"
objExplorer.Document.formName.username.value = "GavinWang"
objExplorer.Document.formName.password.value = "******"
objExplorer.Document.formName.Submit
Posted
Updated 22-Dec-09 22:55pm
v4

1 solution

Just to point out, that's actually VB classic code. While I can't really help much with the properties and methods, you can get the Type representing objExplorer by using Type.GetTypeFromProgID. From there, I'd think that you'd have to do some strange things with the Marshal class and look into the IDispatch interface.

You might want to look into an alternative way of doing things, or (ick) wrapping the script and calling it from the command line using C#. I'd personally find it cleaner to use the former.
 
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