阻止连接到POP服务器的行为。 [英] Blocking behaviour connecting to a POP server.

查看:237
本文介绍了阻止连接到POP服务器的行为。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计们,我有一个问题。



我写了一个VB.NET程序来帮助我处理垃圾邮件。我回答了一个据称真实的Woolworths广告时犯了一个错误,但事实并非如此。现在我收到了很多垃圾邮件。



更糟糕的是,我的ISP最近拒绝让我访问他们的POP服务器,因此我无法使用Outlook或我的应用。我必须使用他们的WebMail功能。



经过一些研究,我发现我可以ping POP服务器并获得结果,但我无法Telnet到它。它只是超时,这是我的问题的核心。



当我进行连接时,程序等待来自POP服务器的响应,我被阻止了我在等待超时。我希望增加一个秒钟的计时器来显示我等待的时间,但当然这是不可能的。



我想到使用Threads就在这附近但是我仍然被封锁了。



所以这两个问题是(潜入,对不起):



1.线程是否可行,我将如何做?或者,



2.有没有办法进行异步连接,所以我没有被阻止?



感谢您的耐心等待。



我的尝试:



请阅读上面的内容,它将所有信息都作为一个故事。

解决方案

嗨伙计,



我使用ConnectAsync方法在第二种方法上取得了一些成功。



由于我使用POP3Client作为我的POP库,需要做更多的工作。无法访问内部。



我开始创建自己的POP类,有点不知所措,试图解释我从服务器读取的内容,因为它可能非常复杂消息和附件都涉及内部编码的类型。



但是我改变了连接到ConnectAsync,添加了一些状态检查,一切都很好。



由于我无法更改POP3Client,也许是时候让我完成课程了。



谢谢。

Hi Folks, I have a question.

I've written a little VB.NET program that helps me deal with spam email. I made a mistake responding to a supposedly real Woolworths ad, but it wasn't. Now I am receiving a lot of spam.

To make matters worse, my ISP is denying me access to their POP server recently, so I can't use Outlook or my app. I have to use their WebMail feature.

After some research, I've discovered that I can ping the POP server and get results, but I cannot Telnet to it. It just times out, which is the heart of my question.

When I do a connection, the program waits for a response from the POP server and I am blocked while I am waiting for the timeout. I was hoping to add a seconds elapsed timer to show how long I was waiting, but of course that's impossible.

I'd thought of using Threads as away around this, but I still get blocked.

So the the two questions are (sneaked that in, sorry):

1. Are Threads the way to go and how would I do it? Or,

2. Is there some way to do an asynchronous connection so I am not blocked?

Thanks for your patience.

What I have tried:

Please read the above, it has all the information as a story.

解决方案

Hi Folks,

I have had some success with the second method using the ConnectAsync method.

Need to do some more work as I'm using the POP3Client as my POP library. No access to the internals.

I started creating my own POP class and sort of became overwhelmed trying to interpret what I read from the server as it can very complicated with all the types of internal coding involved on both the message and the attachments.

However I changed Connect to ConnectAsync, added some status checking and it's all fine.

Since I can't change the POP3Client maybe it's time for me to finish my class.

Thanks.


这篇关于阻止连接到POP服务器的行为。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆