msxml3.dll 访问被拒绝 [英] msxml3.dll Access Denied
问题描述
我有以下代码:
Function filejson(json)
Dim objStream, strData
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.LoadFromFile(json)
strData = objStream.ReadText()
filejson = strData
End Function
Function http2json(url)
Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", url, FALSE
http.send "" '<------- Line 13
http2json=http.responseText
End Function
Function str2json(json,value)
Set scriptControl = CreateObject("MSScriptControl.ScriptControl")
scriptControl.Language = "JScript"
scriptControl.AddCode("x="& json & ";")
str2json= scriptControl.Eval( "x"& value )
End Function
Function get_json_from_file(json,value)
get_json_from_file=str2json(filejson(json),value)
End Function
Function get_json_from_http(url,value)
get_json_from_http=str2json(http2json(url),value)
End Function
Function save_json_from_http(url,loc)
Set fso = CreateObject("Scripting.FileSystemObject")
fullpath = fso.GetAbsolutePathName(loc)
Dim objStream, strData
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.WriteText http2json(url)
objStream.SaveToFile fullpath, 2
save_json_from_http=fullpath
End Function
Wscript.Echo save_json_from_http("http://api.themoviedb.org/3/authentication/session/new?api_key=#####some_api_key_example#####&request_token=#####some_default_request_token######&_ctime_json_=1372670635.164760555","tmdb\temp\_tmdb_sock_w.164519518.2109")
运行此代码时,出现以下错误.
When I run this code, I get the following error.
如果我删除 &request_token=#####some_default_request_token######
它工作得很好.
If I remove &request_token=#####some_default_request_token######
it works just fine.
我也试过这个:我再次添加了request_token
,我只是在其中输入了一个随机字符,例如,rexfuest_token
,奇怪的是它起作用了.msxml3.dll 中似乎有一个错误的解析.带有 request_token 词.
I also tried this: I added again the request_token
, and I just typed a random character in it, for example, rexfuest_token
, and strangely it worked. It seems there's a wrong parse in msxml3.dll. with request_token word.
想法?
推荐答案
尝试使用更新的版本:
Set http = CreateObject("Msxml2.XMLHttp.6.0")
这也可能是您的 Internet 安全设置的问题(请参阅 此处).打开控制面板中的Internet 选项小程序,在安全选项卡中为网站(可能是受信任的站点")选择区域,然后单击自定义级别….
It could also be an issue with your Internet security settings (see here). Open the Internet Options applet in the Control Panel, select the zone for the website (probably "Trusted sites") in the Security tab and click Custom level….
在杂项部分中,将跨域访问数据源设置为启用.
这篇关于msxml3.dll 访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!