嗨我需要从具有表单身份验证的站点下载文件,并使用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