- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 OpenPop.NET 访问 gmail 帐户,但即使使用基本测试代码,我也会收到以下错误消息。
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' at ST_1694f4bcdf2a4068ae871201a2216457.csproj.ScriptMain.Main()
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
我正在尝试在装有 .NET Framework 3.5 和 4 的 Windows 7 机器上的 SQL Server Business Intelligence Development Studio 2008 中的 SSIS 包中执行此操作。OpenPop dll 和引用它的脚本任务都在内置3.5.我已经对此进行了几天的研究,但一直无法找到任何可以修复它的方法。我尝试从源代码重新编译 OpenPop dll,并多次删除和重新添加引用。
我目前正在使用的代码发布在下面:
Pop3Client client = new Pop3Client();
try
{
client.Connect("pop.gmail.com", 995, true);
try
{
client.Authenticate("user@domain.com", "mypassword");
Console.WriteLine("Success");
client.Disconnect();
}
catch
{
Console.WriteLine("Failed to authenticate");
Dts.TaskResult = (int)ScriptResults.Failure;
return;
}
}
catch
{
Console.WriteLine("Failed to connect");
Dts.TaskResult = (int)ScriptResults.Failure;
return;
}
Dts.TaskResult = (int)ScriptResults.Success;
提前谢谢你。
最佳答案
我也遇到过这个问题,解决方法其实很简单。您必须将引用的程序集安装到运行该程序包的服务器的 GAC。
1) 验证程序集是否已签名,如果您创建了自己的程序集,请对其进行签名。
2) 使用 Visual Studio SDK 工具中的 gacutil.exe
将 DLL 安装到 GAC。有关详细信息,请参阅 How to: Install an Assembly into the Global Assembly Cache .
3) 从您的脚本任务中引用相同的 DLL
瞧,它现在应该可以完美运行了!
关于C#:无法加载文件或程序集 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' 或其依赖项之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9999441/
当我尝试删除一条消息时,它会一次删除 4 条消息,即使我明确声明不是这样,因为我有大约 700 条消息,我不得不最多显示 4 条消息。 public void inboxupdate() {
我正在使用 OpenPOP 库获取 Gmail。问题是电子邮件的接收顺序不正确。 pop3 = new Pop3Client(); pop3.Connect("pop.gmail.com", 995,
在openpop中必须调用disconnect()或disposed()来提交删除命令,如何在调用pop3Client.DeleteMessage()时立即删除消息? 最佳答案 我是 OpenPOP
我正在使用 OpenPop 库来阅读电子邮件。我遇到的问题是,在阅读电子邮件正文时,库修改了一个字符。请参阅以下示例: 邮件正文: Diseño C# 代码: OpenPop.Pop3.Pop3
我正在尝试制作一种电子邮件接收器,到目前为止我有一个按钮,按下该按钮会显示最新电子邮件的正文,这正是我想要的,除了我还想要主题、发件人和最重要的时间。代码如下 public static List F
如何将电子邮件从收件箱 移动到某个文件夹,例如文件夹“test” Pop3Client client = new Pop3Client() 客户端包含获取电子邮件的方法,格式为html、xml等。还可
我正在使用 OpenPop.net 尝试从给定收件箱中的所有电子邮件中解析我们的链接。我找到了这个方法来获取所有消息: public static List FetchAllMessages(
我已经创建了一个网络电子邮件应用程序,如何查看和保存附件? 我正在使用第三方 dll OpenPop,我可以发送带附件的电子邮件和阅读没有附件的电子邮件。 这很好用: Pop3Client pop3C
我使用 openpop .net 库通过 POP3 从邮件服务器检索邮件。一切正常,但我无法检索每个邮件附件的大小。我创建了 GetMessageSize(i) 但这个大小是所有附件的总和。 那么问题
我使用 OpenPop.net从服务器获取邮件,但在 OpenPop.net 中找不到发送邮件的方法, 如何发送邮件 OpenPop.net ? 最佳答案 POP3 是一种电子邮件检索协议(proto
我正在尝试使用 openpop.net 创建一个 pop3 电子邮件客户端。这是我在下载功能中尝试过的(来自 gridview 的模板字段): [Serializable] publi
我正在使用 OpenPop.NET 客户端通过 Pop3 协议(protocol)访问我的邮箱。一切都很好,除了一件事:我无法删除消息。连sample从官方网站没有帮助。我试过几个邮件服务器:gmai
可以使用 OpenPop.dll。 Pop3Client objPOP3Client = new Pop3Client(); int intTotalEmail = 0; Da
我在 C# 应用程序中使用 OpenPop.Net 连接到 GoDaddy 托管的电子邮件帐户。 Authenticate() 方法抛出异常,错误消息为“用于检索响应的流已关闭”。我使用 Outloo
我正在使用 openpop 连接到 gmail pop 服务器。 这是代码(很简单) using (var client = new Pop3Client()) { var username
我正在开发一个控制台应用程序,我想从邮件中下载附件(只有一个帐户)。我能够下载附件,如果附件直接附加到邮件,我正在使用OpenPop 库。下面是下载/保存附件的代码。 Pop3Client clien
我有这个代码: public List GetAttachments() { string hostname = "pop.gmail.com"; int port = 995;
我正在使用 OpenPOP我正在尝试从办公室交换服务器中检索邮件。这是我的代码 popClient.Connect(host.Host, (int)host.Port, (bool)host.Ssl
当使用 OpenPop 连接到 Gmail 时,我只能检索一次电子邮件,即使我没有删除它也是如此。使用 GetMessageCount() 我总是收到 0 封电子邮件。我怎样才能得到那里的所有电子邮件
是否可以将 Gmail API 消息转换为 OpenPop Mime 消息? 目前,我有: List messagesList = new List(); List rawMessagesList =
我是一名优秀的程序员,十分优秀!