Javascriptdemo.rar
I write post often encounter with JS to encrypt some sites, and then do not want to use C # rewrite.
In Baidu and the forum to find the JS execution is not 64 bit does not support is to bring a DLL God horse. Very annoying.
And then I wrote a no need to bring a DLL. and support all systems Yo (64-bit also) (Server 2003 multi-threading POST1 months did not crash)
<ignore_js_op>
First, a 13-bit timestamp is believed to play post is more common, such as:1410106357535
[C #]Plain Text view copy code
Type obj = Type.gettypefromprogid ("ScriptControl");
if (obj = = null) return; Single? I can't find the object.
Object ScriptControl = Activator.CreateInstance (obj);
Obj. InvokeMember ("Language", BindingFlags.SetProperty, NULL, ScriptControl, new object[] {"JScript"});
String js = "function time () {return new Date (). GetTime ()}";
Obj. InvokeMember ("Addcode", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {JS});
String str = obj. InvokeMember ("Eval", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {"Time ()"}). ToString ();
TextBox1.Text = str;
Continue to take random numbers such as:0.0117551307930485
[C #]Plain Text view copy code
Type obj = Type.gettypefromprogid ("ScriptControl");
if (obj = = null) return; Single? I can't find the object.
Object ScriptControl = Activator.CreateInstance (obj);
Obj. InvokeMember ("Language", BindingFlags.SetProperty, NULL, ScriptControl, new object[] {"JScript"});
String js = "function random () {return math.random ()}";
Obj. InvokeMember ("Addcode", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {JS});
String str = obj. InvokeMember ("Eval", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {"Random ()"}). ToString ();
TextBox1.Text = str;
Continue to evaluate an expression such as: expression:(5*10-2*10)/2 results for
[C #]Plain Text view copy code
Type obj = Type.gettypefromprogid ("ScriptControl");
if (obj = = null) return; Single? I can't find the object.
Object ScriptControl = Activator.CreateInstance (obj);
Obj. InvokeMember ("Language", BindingFlags.SetProperty, NULL, ScriptControl, new object[] {"JScript"});
String str = obj. InvokeMember ("Eval", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {"(5*10-2*10)/2"}). ToString ();
TextBox1.Text = "(5*10-2*10)/2=" + str;
Continue to the GTK + QQ space, such as:193432059
[C #]Plain Text view copy code
StringBuilder sb = new StringBuilder ();
Sb. Append ("function getgtk (str) {");
Sb. Append ("var hash = 5381;");
Sb. Append ("for (var i = 0,");
Sb. Append ("len = str.length; i < Len; ++i) {");
Sb. Append ("hash + = (hash << 5) + Str.charat (i). charCodeAt ();");
Sb. Append ("}");
Sb. Append ("return hash & 0x7fffffff;");
Sb. Append ("}");
Type obj = Type.gettypefromprogid ("ScriptControl");
if (obj = = null) return; Single? I can't find the object.
Object ScriptControl = Activator.CreateInstance (obj);
Obj. InvokeMember ("Language", BindingFlags.SetProperty, NULL, ScriptControl, new object[] {"JScript"});
Obj. InvokeMember ("Addcode", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {sb. ToString ()});
String str = obj. InvokeMember ("Eval", BindingFlags.InvokeMethod, NULL, ScriptControl, new object[] {"GETGTK (\" 123\ ")"}). ToString ();
TextBox1.Text = str;
No need to add reference to execute JS, publish without DLL, example: QQMD5 qqgtk 13-bit timestamp random number