我正在网站中实现桌面通知,在新邮件到达时显示通知.我希望在用户点击通知时,网站处于打开状态的浏览器标签可以获得焦点,我可以使用以下代码在Chrome中使用此功能:
var n = new Notification('Title', {
'body': 'Sample content.'
});
n.onclick = function (e) {
window.focus();
};
Run Code Online (Sandbox Code Playgroud)
但不幸的是,这在Firefox中不起作用.:(任何人都可以告诉我,我在这里缺少什么?我正在测试Chrome 31和Firefox 26
谢谢.
我编写了一个程序,使用命令C#
连接到POP Server
服务器并从服务器检索原始电子邮件消息字符串.由于程序检索的电子邮件消息是纯文本格式,所有标题和消息正文都相同,因此从原始字符串中提取每个标题和邮件正文太困难了.POP3
RETR
有人能告诉我一个解决方案,我可以将整个原始文本解析为一个System.Net.Mail.MailMessage
对象吗?
以下是电子邮件原始字符串示例:
+OK 1281 octets
Return-Path: <sample@test.in>
Delivered-To: samplenet-sample:in-sample2@test.in
X-Envelope-To: sample2@test.in
Received: (qmail 53856 invoked from network); 22 Sep 2012 06:11:46 -0000
Received: from mailwash18.pair.com (66.39.2.18)
MIME-Version: 1.0
From: "Deepu"
<sample@test.in>
To: sample2@test.in
Date: 22 Sep 2012 11:41:39 +0530
Subject: TEST Subject
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-Id: <20120922061146.2975C11554D@mailwash18.pair.com>
TEST Body
.
Run Code Online (Sandbox Code Playgroud)