Click here to Skip to main content
15,902,933 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?

Set objExplorer = WScript.CreateObject("InternetExplorer.Application", "IE_")
objExplorer.Navigate ""
objExplorer.Document.formName.username.value = "GavinWang"
objExplorer.Document.formName.password.value = "******"
Updated 22-Dec-09 22:55pm

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