嗨我正在尝试以编程方式将网络摄像头添加到Outlook
中Outlook.Application ouApplication = new Outlook.Application();
Outlook.Folder newFolder = ouApplication.GetNamespace("MAPI").OpenSharedFolder("webcalURL") as Outlook.Folder;
但如何查看已添加相同网络摄像头的位置...
if(!AlreadyAdded())
{
Outlook.Application ouApplication = new Outlook.Application();
Outlook.Folder newFolder = ouApplication.GetNamespace("MAPI").OpenSharedFolder("webcalURL") as Outlook.Folder;
}
bool AlreadyAdded()
{
//Check webcal is already added or not
}
答案 0 :(得分:0)
一种方法是在private
中使用class
对象:
private Outlook.Application ouApplication;
if(!AlreadyAdded())
{
ouApplication = new Outlook.Application();
Outlook.Folder newFolder = ouApplication.GetNamespace("MAPI").OpenSharedFolder("webcalURL") as Outlook.Folder;
}
bool AlreadyAdded()
{
return ouApplication!=null;
}
另一种方法是使用singleton
类。
查看参考here.