zoukankan
html css js c++ java
[原创]用XMLHttp BinaryWrite,Post GB2312编码的字串
/**/
/*
作者:阿牛(牛昆亮) QQ:273352165 MSN:niukl@hotmail.com
声明:可以免费使用,请您保留此信息
如果您有什么改过,记得告诉我!
*/
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
"
)
'
建立流对象
ms.Type
=
2
'
Text
ms.Charset
=
charset
'
设置流对象的编码方式为 charset
ms.Open
ms.WriteText str
'
把str写入流对象中
ms.Position
=
0
'
设置流对象的起始位置是0 以设置Charset属性
ms.Type
=
1
'
Binary
vout
=
ms.Read(ms.Size)
'
取字符流
ms.close
'
关闭流对象
Set
ms
=
nothing
Str2Bytes
=
vout
End Function
QQ:273352165 evlon#126.com 转载请注明出处。
查看全文
相关阅读:
Linux中的用户和用户组
GCC编译过程
C++设计模式——单例模式(转)
快速排序之python
归并排序之python
计数排序之python
希尔排序之python
插入排序之python
选择排序之python
冒泡排序之python
原文地址:https://www.cnblogs.com/evlon/p/381627.html
最新文章
yum本地源和网络源的配置
磁盘的分区和挂载(mount)
nginx源码包安装
LVM逻辑卷管理
Oracle 将普通表转换为分区表
Oracle表结构转换SqlSERVER表结构 脚本
审计
ORA-14099 错误解决
oracle 表迁移方法 (一)
oracle 表迁移方法 (二) 约束不失效
热门文章
ociuldr 支持分多个数据文件
oracle 表空间和表 read only迁移后不再read only
【转载】alter table move 和 alter table shrink space的区别
卸载列表信息——Uninstall注册表
硬盘的基本知识
批处理获取当前目录的绝对路径
字符编码
Linux文件权限和访问模式
vi编辑器命令
Fedora 安装gcc gcc-c++
Copyright © 2011-2022 走看看