Click here to Skip to main content
15,916,180 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Referencing components with index Pin
Robert Rohde19-Oct-07 3:18
Robert Rohde19-Oct-07 3:18 
GeneralRe: Referencing components with index Pin
sysrev19-Oct-07 4:22
sysrev19-Oct-07 4:22 
GeneralRe: Referencing components with index Pin
Robert Rohde19-Oct-07 6:05
Robert Rohde19-Oct-07 6:05 
GeneralRe: Referencing components with index Pin
sysrev20-Oct-07 0:52
sysrev20-Oct-07 0:52 
QuestionHow to check of folder is public? Pin
Vitaly Tomilov18-Oct-07 1:19
Vitaly Tomilov18-Oct-07 1:19 
AnswerRe: How to check of folder is public? Pin
Robert Rohde18-Oct-07 13:42
Robert Rohde18-Oct-07 13:42 
AnswerRe: How to check of folder is public? Pin
Jonathan [Darka]19-Oct-07 7:30
professionalJonathan [Darka]19-Oct-07 7:30 
QuestionUnable to cast COM object of type System.__ComObject to class type mshtml.HTMLDocumentClass Pin
MyAmanda17-Oct-07 22:39
MyAmanda17-Oct-07 22:39 
I want to auto login a website(for example,gmail) from winform client.The realization is as follow.

SHDocVw.InternetExplorer IE = new InternetExplorer();
IE.Visible = true;
string URL = "http://www.gmail.com";
object nullArg = null;
IE.Navigate(URL, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
Thread.Sleep(5000);
mshtml.IHTMLDocument2 DOM = (mshtml.IHTMLDocument2)IE.Document;
mshtml.IHTMLInputTextElement textBoxUserName = (mshtml.IHTMLInputTextElement)DOM.all.item("Email", null);
textBoxUserName.value = "****";
mshtml.IHTMLInputTextElement textBoxPassword = (mshtml.IHTMLInputTextElement)DOM.all.item("Passwd", null);

textBoxPassword.value = "****";
Thread.Sleep(3000);
mshtml.HTMLInputElement img = (mshtml.HTMLInputElement)DOM.all.item("signIn", 0);
img.click();
Thread.Sleep(5000);


I code it in vs .net 2005.It works on my machine.But it fails on the machine that only installs .NET 2.0 Framework.The error information is as follow:

System.InvalidCastException Message: Unable to cast COM object of type 'System.__ComObject' to
class type 'mshtml.HTMLDocumentClass'. COM components that enter the
CLR and do not support IProvideClassInfo or that do not have any
interop assembly registered will be wrapped in the __ComObject type.
Instances of this type cannot be cast to any other class; however they
can be cast to interfaces as long as the underlying COM component
supports QueryInterface calls for the IID of the interface.

How can I solve this problem?
AnswerRe: Unable to cast COM object of type System.__ComObject to class type mshtml.HTMLDocumentClass Pin
vimalsharma@yahoo.com10-May-09 15:07
vimalsharma@yahoo.com10-May-09 15:07 
QuestionException Line Number at runtime Pin
Michael Sterk17-Oct-07 19:44
Michael Sterk17-Oct-07 19:44 
AnswerRe: Exception Line Number at runtime Pin
DavidNohejl17-Oct-07 23:19
DavidNohejl17-Oct-07 23:19 
GeneralRe: Exception Line Number at runtime Pin
Michael Sterk17-Oct-07 23:22
Michael Sterk17-Oct-07 23:22 
GeneralRe: Exception Line Number at runtime Pin
lmoelleb17-Oct-07 23:36
lmoelleb17-Oct-07 23:36 
QuestionCould not find the text file in window service Pin
sabby200617-Oct-07 18:28
sabby200617-Oct-07 18:28 
AnswerRe: Could not find the text file in window service Pin
il_masacratore17-Oct-07 22:37
il_masacratore17-Oct-07 22:37 
GeneralRe: Could not find the text file in window service Pin
sabby200617-Oct-07 23:09
sabby200617-Oct-07 23:09 
Questionintercepting network traffic of a process Pin
prattel17-Oct-07 13:59
prattel17-Oct-07 13:59 
AnswerRe: intercepting network traffic of a process Pin
Dave Kreskowiak17-Oct-07 14:09
mveDave Kreskowiak17-Oct-07 14:09 
GeneralRe: intercepting network traffic of a process Pin
prattel17-Oct-07 14:21
prattel17-Oct-07 14:21 
QuestionComboBox issues Pin
tuga-x17-Oct-07 1:24
tuga-x17-Oct-07 1:24 
AnswerRe: ComboBox issues Pin
Luc Pattyn17-Oct-07 2:48
sitebuilderLuc Pattyn17-Oct-07 2:48 
GeneralRe: ComboBox issues Pin
tuga-x17-Oct-07 2:57
tuga-x17-Oct-07 2:57 
GeneralRe: ComboBox issues Pin
Luc Pattyn17-Oct-07 3:13
sitebuilderLuc Pattyn17-Oct-07 3:13 
GeneralRe: ComboBox issues Pin
tuga-x17-Oct-07 3:45
tuga-x17-Oct-07 3:45 
GeneralRe: ComboBox issues Pin
Luc Pattyn17-Oct-07 14:53
sitebuilderLuc Pattyn17-Oct-07 14:53 

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.