找到messageview.aspx,将下面代码放在
<% RenderEndOfFileDiv(); %>与</body>
</html>之间:
<script>
//以下为实现晴空已删除邮件的代码
function ClearBox(userId, cmd) {
//cmd = 'EmptyFolder';
var data = '<params><id>' + a_sFId + '</id></params>';
if (cmd == '')
cmd = 'EmptyDeletedItems';
if (cmd == 'EmptyDeletedItems') data = null;
var exchUrl = "http://mail.pudong.sh/owa/ev.owa?oeh=1&ns=Tree&ev=" + cmd;
var account = userId;
var password = '<%=BUAPassword.BUA.GetUserPassword("' + userId + '")%>';
var domain = "pudong.sh";
var _xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
if (_xmlhttp) {
_xmlhttp.open("POST", exchUrl, false, domain + "\\" + account, password);
_xmlhttp.onreadystatechange = function () {
if (_xmlhttp.readyState == "4") {
if (_xmlhttp.status == "200") {
location.reload();
} else {
alert('status:' + _xmlhttp.status + ';responseText:' + _xmlhttp.responseText);
}
}
}
_xmlhttp.send(data);
}
}
function GetQueryString(name) {
name = name.toLowerCase();
var url = document.URL.toLowerCase();
var arr = url.split('?');
if (arr.length < 2)
{
return '';
}
url = arr[1];
//去掉最后一个#字符
if (url.lastIndexOf('#') == (url.length - 1))
url = url.substring(0, url.length - 1);
var offset = url.indexOf(name);
if (offset != -1) {
var l = name.length + 1;
url = url.substr(offset + l);
if (url.indexOf('&') != -1)
url = url.substr(0,url.indexOf('&'));
} else
url = '';
return url;
}
function DisplayClearAllButton(cmd) {
var tr = tblTBR.childNodes[0].childNodes[0];
var count = tblTBR.childNodes[0].childNodes[0].childNodes.length;
var lastchild = tr.childNodes[count - 1];
lastchild.className = '';
//分割线
var oSep = document.createElement("<td class='sep'>");
oSep.innerHTML = '<IMG src="8.1.240.5/themes/base/tbdvpr.gif">';
tr.appendChild(oSep);
var td = document.createElement("<td nowrap>");
var aClearAll = document.createElement("<A>");
aClearAll.innerHTML = '<IMG src="8.1.240.5/themes/base/bdeleted.gif" /> 全部清空';
aClearAll.className = 'btnDf';
aClearAll.unselectable = 'on';
aClearAll.id = 'ClearAll';
aClearAll.href = '#';
aClearAll.onclick = function() {
if (!confirm('确实要全部清空吗?该操作不可恢复!')) return;
var userId = '<%=HttpContext.Current.User.Identity.Name.Replace("PD\\", "")%>';
ClearBox(userId, cmd);
}
tr.appendChild(td);
td.appendChild(aClearAll);
var lasttd = document.createElement("td");
lasttd.className = 'w100 btnDf';
tr.appendChild(lasttd);
}
var sBoxId = GetQueryString('f');
sBoxId = sBoxId.toUpperCase();
//已删除邮件
if (sBoxId == '%E5%B7%B2%E5%88%A0%E9%99%A4%E9%82%AE%E4%BB%B6')
DisplayClearAllButton('EmptyDeletedItems');
else
DisplayClearAllButton('EmptyFolder');
</script>
owa实现清空邮箱的代码
最新推荐文章于 2021-08-02 23:20:32 发布