0
私はC#を初めて使用しています。IEBrowserを開いて読み込んだコードを書いています。InternetExplorer C#でDocumentCompleteEventHandlerが起動しない
あなたはここで
下のメインのコードが表示されている場合は、私のコードです:
public delegate void DocumentCompleteEventHandler(SHDocVw.InternetExplorer IE);
class Program{
private static string m_autoLoginFormContents = null;
private static SHDocVw.InternetExplorer m_autologinIEWindow;
static SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler m_AutoLoginDocCompleteHandler;
private static SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler m_documentCompleteEventHandler;
public static event DocumentCompleteEventHandler DocumentComplete;
static void Main(string[] args)
{
m_documentCompleteEventHandler = new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(DocumentCompleteEventHandler);
m_autologinIEWindow = OpenIEWindowToURL("about:blank");
m_autologinIEWindow.DocumentComplete += m_AutoLoginDocCompleteHandler;
m_AutoLoginDocCompleteHandler = new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(URLAutologinDocumentCompleteEventHandler);
System.Console.Read();
}
public static void URLAutologinDocumentCompleteEventHandler(object senderObject, ref object objectTwo /* not sure what this argument is for */)
{
//Something
}
private static void DocumentCompleteEventHandler(object senderObject, ref object objectTwo /* not sure what this argument is for */)
{
//Something
}
}
、必要に応じてIEのウィンドウが空白のページを開きますが、イベントが解雇されることはありません、ofcourseの私はやっています何か間違っています。私はスーパーで、おそらくC#の最初のコードです。