嗨我需要從具有表單身份驗證的站點下載文件,並使用Integration Services進一步處理文本文件。關於SSIS腳本組件的WATIN - 單線程公寓
對於文件下載我選擇使用華廷,於是我進口華廷庫和腳本的瀏覽器的步驟。但是,當我嘗試運行代碼時,我收到了帶有此消息的異常。
The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.
這一切使用 (與方法屬性)
如果我嘗試使用下面這行代碼將其設置爲STA
System.Threading.Thread.CurrentThread.SetApartmentState(Threading.ApartmentState.STA)
我得到這個例外
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Failed to set the specified COM apartment state. at System.Threading.Thread.SetApartmentState(ApartmentState state)
如何更改SSIS腳本任務以使用此單線程單元?
很大,當我這樣做時,沒有可能在SSIS上使用C#,謝謝! – 2015-07-31 20:36:22