Tag: 即时

运算符as和generics类

我正在为CLR脚本编写.NET On-the-Fly编译器,并希望执行方法使得generics可接受: object Execute() { return type.InvokeMember(..); } T Execute() { return Execute() as T; /* doesn’t work: The type parameter ‘T’ cannot be used with the ‘as’ operator because it does not have a class type constraint nor a ‘class’ constraint */ // also neither typeof(T) not T.GetType(), so on are possible return (T) […]

寻找新电子邮件的实时IMAP通知

我正在寻找一种方法来监控GMail收件箱中的新电子邮件。 但是,我想避免每隔几分钟检查一次,我正在寻找某种实时通知。 我注意到Outlook(以及其他支持IMAP的客户端)会在有新电子邮件时立即显示,但遗憾的是所有.NET IMAP库似乎都缺少此function。 有谁知道有这个function的IMAP库? 或者是否有另一种方法可以在不进行短期轮询的情况下立即通知新消息?