我目前正在开发的C#一个小应用程序。网络允许执行不同的任务,但在这里我的任务之一,我必须打开从Lotus一个新的默认邮件。不过,我不就可以发现很多文档,所以我有点失落,这就是为什么我在你的手中是:/所以我只需要能够与新的默认的电子邮件打开Lotus。预先感谢 ;)
我建议你使用硒网络驱动程序来访问他们的网站并自动创建一个电子邮件帐户。
操纵应用它的自我可以很复杂,你可以使用.NET窗口输入模拟器Nugat包来模拟用户输入到应用程序或使用Windows API直接写入内存。
我不认为有这样做,由Lotus的支持方式。
但是,如果你可以使用Gmail有一个Gmail的API https://developers.google.com/gmail/api/guides/使用.NET HttpClient的与它进行交互。并创建Gmail帐户https://developers.google.com/admin-sdk/directory/v1/guides/manage-users
public void ComposeMemo(String sendto, String subject, String body)
{
//BLOC1 instantiate a Notes session and workspace
Type NotesSession = Type.GetTypeFromProgID("Notes.NotesSession");
Type NotesUIWorkspace = Type.GetTypeFromProgID("Notes.NotesUIWorkspace");
Object sess = Activator.CreateInstance(NotesSession);
Object ws = Activator.CreateInstance(NotesUIWorkspace);
//BLOC2 open current user's mail file
String mailServer = (String)NotesSession.InvokeMember("GetEnvironmentString", BindingFlags.InvokeMethod, null, sess, new Object[] { "MailServer", true });
String mailFile = (String)NotesSession.InvokeMember("GetEnvironmentString", BindingFlags.InvokeMethod, null, sess, new Object[] { "MailFile", true });
NotesUIWorkspace.InvokeMember("OpenDatabase", BindingFlags.InvokeMethod, null, ws, new Object[] { mailServer, mailFile });
Object uidb = NotesUIWorkspace.InvokeMember("GetCurrentDatabase", BindingFlags.InvokeMethod, null, ws, null);
Object db = NotesUIWorkspace.InvokeMember("Database", BindingFlags.GetProperty, null, uidb, null);
Type NotesDatabase = db.GetType();
//BLOC3 compose a new memo
Object uidoc = NotesUIWorkspace.InvokeMember("ComposeDocument", BindingFlags.InvokeMethod, null, ws, new Object[] { mailServer, mailFile, "Memo", 0, 0, true });
Type NotesUIDocument = uidoc.GetType();
NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "EnterSendTo", sendto });
NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "Subject", subject });
NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "Body", body });
//BLOC4 bring the Notes window to the front
String windowTitle = (String)NotesUIDocument.InvokeMember("WindowTitle", BindingFlags.GetProperty, null, uidoc, null);
Interaction.AppActivate(windowTitle);
}
该BLOC1表现不佳,打开应用程序,但是从BLOC2应用不再响应,但我不知道为什么,更BLOC4字交互作用不认可