我想從Javascript中調用Silver Light方法。 註冊了一個方法,並嘗試打開一個新的Outlook電子郵件。Silverlight中的[ScriptableMember]中打開Outlook電子郵件時出錯
但我收到此錯誤:
Error: System.NotSupportedException: This operation is not supported in the current context. at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args) at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)
- 我已經配置了銀色的光芒項目以提升權限
這個運行在瀏覽器外使用的代碼IA方法:
var olMail = outlook.CreateItem(0);
//olMail.To = txtTO.Text;
//olMail.Cc = txtCC.Text;
olMail.Attachments.Add(@"C:\\temp\\Test_pdf.pdf");
olMail.Subject = "Subject of email.";
olMail.HTMLBody = "This is first email.";
olMail.Display();
//olMail.Save();
//You can send a mail by using Send() method.
//olMail.Send();
謝謝,但我很困惑,爲什麼脂肪酶正在寫文章:** http://www.devcurry.com/2011/05/silverlight-4-and-com-sending-mails.html**這是可能的? – user3009206