我有一个应用程序调用
Email hello = new Email(appropriate constructor);
hello.Email_Send();
Run Code Online (Sandbox Code Playgroud)
我收到了例外:
由于以下错误,检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:80080005服务器执行失败(HRESULT异常:0x80080005(CO_E_SERVER_EXEC_FAILURE)).
来自System.Runtime.InteropServices.COMException.
using O = Microsoft.Office.Interop.Outlook;
class Email
{
public void Email_Send()
{
O.Application outlook = new O.Application(); //Exception thrown here.
O.MailItem message = outlook.CreateItem(O.OlItemType.olMailItem);
message.To = Receiver;
message.CC = Sender;
message.Subject = Subject;
message.Body = "This is an automated message sent at " + DateTime.Now.ToString("HH:mm:ss") + " about " + Body_Topic + System.Environment.NewLine + Body_Content ;
message.Send();
}
}
Run Code Online (Sandbox Code Playgroud)
此错误以前从未发生过,并且我所知道的代码没有任何变化.http://support.microsoft.com/kb/825118似乎不符合我的症状 - 我的电脑没有停止响应等.任何诊断问题的帮助将不胜感激!
经过一些调试后,看起来我在CasperJS中单击或触发此按钮的单击事件时遇到困难:
<a id="generate" class="btn" href="#generate"><strong>Generate</strong></a>
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止的代码:
var casper = require('casper').create({
clientScripts: [
'...\\JQuery\\jquery-1.11.1.min.js'
],
pageSettings: {
userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0'
}
});
casper.on('page.initialized', function (page) {
page.evaluate(function () {
(function() {
window.screen = {
width: 1600,
height: 900
};
var fake_nav = {};
for (var i in navigator) {
fake_nav[i] = navigator[i];
}
fake_nav.javaEnabled = function() { return true; };
fake_nav.language = 'en-US';
window.navigator = fake_nav;
})();
});
});
casper.start('http://www.json-generator.com/', function() {
this.echo("Loaded successfully.");
}); … 我正在使用 System.Windows.Automation 从组框中的标签中获取一些 UI 控件文本值。我正在尝试使用 spy++ 来获取我正在寻找的控件名称。

AutomationElement Root = AutomationElement.RootElement;
AutomationElement MainForm = Root.FindFirst(TreeScope.Descendants,new PropertyCondition(AutomationElement.AutomationIdProperty,"control name im looking for"));
Run Code Online (Sandbox Code Playgroud)
什么值代表我要搜索的内容?例如,我会将其更改为... ...AutomationIdProperty,"Window 00031BB0"));
我不确定 spy++ 提供的所有信息实际上代表什么。
感谢您的任何帮助!
在SQL Server中,这些基本上做同样的事情.每次都这样做的利弊是什么?
select * into table
Run Code Online (Sandbox Code Playgroud)
与
insert into table select *
Run Code Online (Sandbox Code Playgroud)
我正在寻找性能,最佳实践,可维护性等原因.