Resources for IT Professionals > 포럼 홈 > Interoperability Conversations (Archived) > Internet ExplorerClass Visible property not working when InternetExplorerClass is instantiated in a web service
질문하기질문하기
 

답변됨Internet ExplorerClass Visible property not working when InternetExplorerClass is instantiated in a web service

  • 2008년 12월 17일 수요일 오전 11:07kpapa 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    Hello,
    I'm trying to open a new Internet Explorer window each time a web method of a certain web service is called.
    The window seems to be created as I can see the process iexplore.exe in the task manager, but is always invisible even if I set Visible property of InternetExplorerClass instance to true.
    Below is the code I am using:

     [WebMethod] 
        public string OpenIE() { 
            ThreadStart ts = delegate 
                                 { 
                                     InternetExplorer ie = new InternetExplorerClass(); 
                                     ie.Visible = true
                                      
                                 }; 
            Thread t = new Thread(ts); 
            t.SetApartmentState(ApartmentState.STA); 
            t.Start(); 
            t.Join(); 
            return string.Empty; 
        } 

    The above code executes successfully and produces no exceptions.
    Does anyone know what the problem could be?
    Thanks


    Kostas Papakonstantinou

답변

모든 응답