下面一段javascript代码,是将数据post给服务器端.
<script language="javascript" type="text/javascript">
var xmlHttpRequest;
function Button1_onclick()
{
var xmlDoc;
var xmlFilePath="C:/sql.xml";
if(window.ActiveXObject)// code for IE
{
xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async = false;
xmlDoc.load("c:/sql.xml");
}
xmlHttpRequest=new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.onreadystatechange=handleStateChange;
xmlHttpRequest.open("POST", "http://localhost/test0304/default.aspx", true);
xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpRequest.send(xmlDoc);
}
function handleStateChange()
{
var test=xmlHttpRequest.readyState;
if(xmlHttpRequest.readyState==4)
{
alert(xmlHttpRequest.status);
if(xmlHttpRequest.status==200)
{
}
}
}
</script>
把这段代码放在VS2005或者VS2008里面的asp或者html里面都不能运行成功,
问题就在xmlDoc.load("c:/sql.xml");
而把这段代码拿出来直接新建一个HTML文件,就能运行成功.
请问是不是要改web.config文件,或者其它,望大家指点!
<script language="javascript" type="text/javascript">
var xmlHttpRequest;
function Button1_onclick()
{
var xmlDoc;
var xmlFilePath="C:/sql.xml";
if(window.ActiveXObject)// code for IE
{
xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async = false;
xmlDoc.load("c:/sql.xml");
}
xmlHttpRequest=new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.onreadystatechange=handleStateChange;
xmlHttpRequest.open("POST", "http://localhost/test0304/default.aspx", true);
xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpRequest.send(xmlDoc);
}
function handleStateChange()
{
var test=xmlHttpRequest.readyState;
if(xmlHttpRequest.readyState==4)
{
alert(xmlHttpRequest.status);
if(xmlHttpRequest.status==200)
{
}
}
}
</script>
把这段代码放在VS2005或者VS2008里面的asp或者html里面都不能运行成功,
问题就在xmlDoc.load("c:/sql.xml");
而把这段代码拿出来直接新建一个HTML文件,就能运行成功.
请问是不是要改web.config文件,或者其它,望大家指点!
这个调控件的要权限可能在VS里调试就像你浏览别的网站一样,他没有那种高的FSO权限的.
我本来就是要将客户本地的xml传给服务器端,如果这样做就失去意义了.
还有其他办法么?
ps:
我不是鳞兄