function Edit_Click() {
ExtendWindow();
SetFormHtml('Edit Item');
DisabledButton(true);
var Index = parseInt(urls.options[urls.selectedIndex].value);
$('txtDescription').value = aryFeeds[Index].cms;
$('txtReferer').value = aryFeeds[Index].ref;
$('txtTarget').value = aryFeeds[Index].tar;
$('btnCancel').onclick = Cancel_Click;
$('btnOK').onclick = Edit_OK_Click;
}
function Delete_Click() {
var Index = parseInt(urls.options[urls.selectedIndex].value);
var Node = xmldoc.selectSingleNode('/feeds/feed[@id="' + aryFeeds[Index].id + '"]');
if (urls.length == 1) curFeedID = "0";
else {
var tempIndex = urls.selectedIndex + 1;
if (tempIndex < urls.length) {
var Index2 = parseInt(urls.options[tempIndex].value);
curFeedID = aryFeeds[Index2].id;
} else {
tempIndex = urls.selectedIndex - 1;
var Index2 = parseInt(urls.options[tempIndex].value);
curFeedID = aryFeeds[Index2].id;
}
}
Node.parentNode.removeChild(Node);
ShowResults();
}
function Find_Click() {
}
function Cancel_Click() {
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function CheckFeed() {
var flag = true;
var description = $('txtDescription').value;
var referer = $('txtReferer').value;
var target = $('txtTarget').value;
if (description == "" || referer == "" || target == "") flag = false;
if (referer.substr(0,7) != "http://") flag = false;
if (target.substr(0,7) != "http://") flag = false;
return flag;
}
function AppendXmlNode() {
var root = xmldoc.documentElement;
var Node = xmldoc.createElement('feed');
var id = getMaxFeedID() + 1;
curFeedID = id;
Node.setAttribute('id', getMaxFeedID() + 1);
Node.setAttribute('cms', $('txtDescription').value);
Node.setAttribute('tar', $('txtTarget').value);
Node.setAttribute('ref', $('txtReferer').value);
root.appendChild(Node);
}
function Add_OK_Click() {
if (CheckFeed()) {
AppendXmlNode();
ShowResults();
}
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function UpdateXmlNode(Node) {
Node.setAttribute('cms', $('txtDescription').value);
Node.setAttribute('tar', $('txtTarget').value);
Node.setAttribute('ref', $('txtReferer').value);
}
function Edit_OK_Click() {
var Index = parseInt(urls.options[urls.selectedIndex].value);
var Node = xmldoc.selectSingleNode('/feeds/feed[@id="' + aryFeeds[Index].id + '"]');
if (CheckFeed()) {
curFeedID = aryFeeds[Index].id;
UpdateXmlNode(Node);
ShowResults();
}
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function DisabledButton(boolValue) {
$('urls').disabled = boolValue;
$('btnAdd').disabled = boolValue;
$('btnEdit').disabled = boolValue;
$('btnDelete').disabled = boolValue;
$('btnFind').disabled = boolValue;
$('btnSpoof').disabled = boolValue;
}function SetFormHtml(caption) {
var htmlTable = '<table cellspacing=0 cellpadding=0><tr><td colspan=2>';
htmlTable += '<fieldset style="padding:8px;width:465;border:2px groove transparent; color:#000000; line-height:2.0; font-size:12px;"><legend>' + caption + '</legend>';
htmlTable += '<table>';
htmlTable += '<tr><td><label>Description</label></td></tr>';
htmlTable += '<tr><td><input id="txtDescription" type="text" class="text"></td></tr>';
htmlTable += '<tr><td><label>Referer</label></td></tr>';
htmlTable += '<tr><td><input id="txtReferer" type="text" class="text"></td></tr>';
htmlTable += '<tr><td><label>Target</label></td></tr>';
htmlTable += '<tr><td><input id="txtTarget" type="text" class="text"></td></tr>';
htmlTable += '</table>';
htmlTable += '</fieldset>';
htmlTable += '</td></tr>';
htmlTable += '<tr>';
htmlTable += '<td align="left"><input type="button" value="OK" id="btnOK" class="button"></td>';
htmlTable += '<td align="right"><input type="button" value="Cancel" id="btnCancel" class="button"></td>';
htmlTable += '</tr></table>';
$('ActiveArea').innerHTML = htmlTable;
}
</script>
</head>
<body onload="Init()" scroll="no" oncontextmenu="if(event.srcElement.tagName!='INPUT')return false" onselectstart="if(event.srcElement.tagName!='INPUT')return false" bgcolor="buttonface" topmargin=8 bottommargin=0>
<table border=0 cellspacing=0 cellpadding=2>
<tr><td><select name="urls" id="urls" style="width:400"></select></td><td><input type="button" id="btnSpoof" onclick="Foops()" class="button" value="Spoof" title="click this button to spoof"></td></tr>
<tr><td>
<input type="button" AccessKey="A" value="Add" id="btnAdd" class="button">
<input type="button" value="Edit" id="btnEdit" class="button">
<input type="button" value="Delete" id="btnDelete" class="button">
<input type="button" value="Find" id="btnFind" class="button">
</td>
<td align="right">
<input type="button" value="Exit" id="btnExit" class="button">
</td>
</tr>
<tr>
<td colspan=2 id="ActiveArea"></td>
</tr>
</table>
</body>
</html>
ExtendWindow();
SetFormHtml('Edit Item');
DisabledButton(true);
var Index = parseInt(urls.options[urls.selectedIndex].value);
$('txtDescription').value = aryFeeds[Index].cms;
$('txtReferer').value = aryFeeds[Index].ref;
$('txtTarget').value = aryFeeds[Index].tar;
$('btnCancel').onclick = Cancel_Click;
$('btnOK').onclick = Edit_OK_Click;
}
function Delete_Click() {
var Index = parseInt(urls.options[urls.selectedIndex].value);
var Node = xmldoc.selectSingleNode('/feeds/feed[@id="' + aryFeeds[Index].id + '"]');
if (urls.length == 1) curFeedID = "0";
else {
var tempIndex = urls.selectedIndex + 1;
if (tempIndex < urls.length) {
var Index2 = parseInt(urls.options[tempIndex].value);
curFeedID = aryFeeds[Index2].id;
} else {
tempIndex = urls.selectedIndex - 1;
var Index2 = parseInt(urls.options[tempIndex].value);
curFeedID = aryFeeds[Index2].id;
}
}
Node.parentNode.removeChild(Node);
ShowResults();
}
function Find_Click() {
}
function Cancel_Click() {
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function CheckFeed() {
var flag = true;
var description = $('txtDescription').value;
var referer = $('txtReferer').value;
var target = $('txtTarget').value;
if (description == "" || referer == "" || target == "") flag = false;
if (referer.substr(0,7) != "http://") flag = false;
if (target.substr(0,7) != "http://") flag = false;
return flag;
}
function AppendXmlNode() {
var root = xmldoc.documentElement;
var Node = xmldoc.createElement('feed');
var id = getMaxFeedID() + 1;
curFeedID = id;
Node.setAttribute('id', getMaxFeedID() + 1);
Node.setAttribute('cms', $('txtDescription').value);
Node.setAttribute('tar', $('txtTarget').value);
Node.setAttribute('ref', $('txtReferer').value);
root.appendChild(Node);
}
function Add_OK_Click() {
if (CheckFeed()) {
AppendXmlNode();
ShowResults();
}
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function UpdateXmlNode(Node) {
Node.setAttribute('cms', $('txtDescription').value);
Node.setAttribute('tar', $('txtTarget').value);
Node.setAttribute('ref', $('txtReferer').value);
}
function Edit_OK_Click() {
var Index = parseInt(urls.options[urls.selectedIndex].value);
var Node = xmldoc.selectSingleNode('/feeds/feed[@id="' + aryFeeds[Index].id + '"]');
if (CheckFeed()) {
curFeedID = aryFeeds[Index].id;
UpdateXmlNode(Node);
ShowResults();
}
$('ActiveArea').innerHTML = '';
ChangeButtonStatus();
ShrinkWindow();
}
function DisabledButton(boolValue) {
$('urls').disabled = boolValue;
$('btnAdd').disabled = boolValue;
$('btnEdit').disabled = boolValue;
$('btnDelete').disabled = boolValue;
$('btnFind').disabled = boolValue;
$('btnSpoof').disabled = boolValue;
}function SetFormHtml(caption) {
var htmlTable = '<table cellspacing=0 cellpadding=0><tr><td colspan=2>';
htmlTable += '<fieldset style="padding:8px;width:465;border:2px groove transparent; color:#000000; line-height:2.0; font-size:12px;"><legend>' + caption + '</legend>';
htmlTable += '<table>';
htmlTable += '<tr><td><label>Description</label></td></tr>';
htmlTable += '<tr><td><input id="txtDescription" type="text" class="text"></td></tr>';
htmlTable += '<tr><td><label>Referer</label></td></tr>';
htmlTable += '<tr><td><input id="txtReferer" type="text" class="text"></td></tr>';
htmlTable += '<tr><td><label>Target</label></td></tr>';
htmlTable += '<tr><td><input id="txtTarget" type="text" class="text"></td></tr>';
htmlTable += '</table>';
htmlTable += '</fieldset>';
htmlTable += '</td></tr>';
htmlTable += '<tr>';
htmlTable += '<td align="left"><input type="button" value="OK" id="btnOK" class="button"></td>';
htmlTable += '<td align="right"><input type="button" value="Cancel" id="btnCancel" class="button"></td>';
htmlTable += '</tr></table>';
$('ActiveArea').innerHTML = htmlTable;
}
</script>
</head>
<body onload="Init()" scroll="no" oncontextmenu="if(event.srcElement.tagName!='INPUT')return false" onselectstart="if(event.srcElement.tagName!='INPUT')return false" bgcolor="buttonface" topmargin=8 bottommargin=0>
<table border=0 cellspacing=0 cellpadding=2>
<tr><td><select name="urls" id="urls" style="width:400"></select></td><td><input type="button" id="btnSpoof" onclick="Foops()" class="button" value="Spoof" title="click this button to spoof"></td></tr>
<tr><td>
<input type="button" AccessKey="A" value="Add" id="btnAdd" class="button">
<input type="button" value="Edit" id="btnEdit" class="button">
<input type="button" value="Delete" id="btnDelete" class="button">
<input type="button" value="Find" id="btnFind" class="button">
</td>
<td align="right">
<input type="button" value="Exit" id="btnExit" class="button">
</td>
</tr>
<tr>
<td colspan=2 id="ActiveArea"></td>
</tr>
</table>
</body>
</html>
只需要到POST HTTP头。加上 referer 即可。
x.open("GET","http://www.never-online.net",false);
x.SetRequestHeader("REFERER","http://community.csdn.net");
x.send(null)
WebBrowser.Navigate(Url, Flags, TargetFrameName, PostData, Headers);
客户端修改REFERER欺骗服务端我也做过:
http://bbs.51js.com/viewthread.php?tid=60063
我试过xmlhttp抓回的结果,不能显示图片呀,所以用这个自己觉得最好用。