Skip to content

Instantly share code, notes, and snippets.

Function Get-Data {
Param (
[int] $data = -1
)
return $data;
}
[Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") > $null
[System.EnterpriseServices.Internal.Publish] $publish =
New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("<DLL的完整路径>")
var x = {
value:"x",
a:function() {
alert(this.value);
}
};
var y = {
value: "y",
a:x.a
};
var xmlhttp = NewXmlHttpRequest();
xmlhttp.open("Get", "http://leonax.net", false);
xmlhttp.send();
alert(xmlhttp.responseText);
var xmlhttp = NewXmlHttpRequest();
xmlhttp.open("Get", "http://leonax.net");
xmlhttp.send();
var command = WScript.Arguments.Item(0);
var argument = "";
for (var i = 0; i < WScript.Arguments.Count(); ++i){
argument += WScript.Arguments.Item(i) + " ";
}
try{
var shellapp = new ActiveXObject("Shell.Application");
shellapp.ShellExecute(command, argument, null, "runas", 1);
}
var xmlhttp = NewXmlHttpRequest();
xmlhttp.open("GET", "http://leonax.net/feed/", false);
xmlhttp.send();
var doc = xmlhttp.responseXML;
var items = doc.selectNodes("//item");
for (var i = 0; i < items.length; ++i) {
var item = items[i];
var title = item.selectSingleNode("title");
var link = item.selectSingleNode("link");
alert(title.text + " @ " + link.text);
var xmlhttp = NewXmlHttpRequest();
xmlhttp.open("GET", "http://leonax.net/feed/", false);
xmlhttp.responseXML.setProperty("MaxElementDepth", 1);
xmlhttp.send();
var doc = xmlhttp.responseXML;
alert(doc.parseError.reason);
var xhr = NewXmlHttpRequest();
xhr.open("GET", "http://leonax.net/", false);
//Pretend to be safari on iPhone
xhr.setRequestHeader("User-Agent",
"Mozilla/5.0 (iPhone; U; us; CPU iPhone OS 4_2_1 like Mac OS X; us) " +
"AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148" +
"a Safari/6533.18.5");
xhr.send();
alert("iPhone Content length = " + xhr.responseText.length);
xhr.open("GET", "http://leonax.net/", false);
var xhr = NewXmlHttpRequest();
xhr.open("GET", "http://leonax.net/", false);
xhr.send();
alert(xhr.status + " " + xhr.statusText);
xhr.open("GET", "http://leonax.net/PageNotFound/", false);
xhr.send();
alert(xhr.status + " " + xhr.statusText);