/**//*
Author: A niu (NIU kunliang) QQ: 273352165 MSN: niukl@hotmail.com
Disclaimer: free of charge. Please keep this information
If you have any questions, please tell me!
*/
Function Postdatatourl (strurl, strcontent)
Set XMLHTTP = Createobject ( " Msxml2.xmlhttp " )
XMLHTTP. Open " Post " , Strurl, False
XMLHTTP. setRequestHeader " Content-Type " , " Text/XML; charset = gb2312; "
Vout = Str2bytes (strcontent, " Gb2312 " )
XMLHTTP. setRequestHeader " Content-Length " , Len (Vout)
XMLHTTP. Send (Vout)
Strxml = XMLHTTP. responsetext
Set XMLHTTP = Nothing
Postdatatourl = Strxml
End Function
Function Str2bytes (STR, charset)
Dim MS, strret.
Set MS = Createobject ( " ADODB. Stream " ) ' Create Stream Object
Ms. Type = 2 ' Text
Ms. charset = Charset ' Sets the stream object encoding method to charset.
Ms. Open
Ms. writetext Str ' Write STR into Stream Object
Ms. Position = 0 ' Set the starting position of the stream object to 0 to set the charset attribute.
Ms. Type = 1 ' Binary
Vout = Ms. Read (Ms. Size) ' Stream pulling
Ms. Close ' Close Stream Object
Set MS = Nothing
Str2bytes = Vout
End Function