1. ASP如何在后台获取其他网站的内容
采集,这个涉及到的东西多了。
只要你能看到的页面,都可以通过程序采集回来,存到你的数据库中去的。
2. 如何用asp获取json数据后返回结果,并把数据类型输出来
调用toObject方法就好了,对应asp的dit对象:
<script language="JScript" runat="Server">
function toObject(json) {
eval("var o=" + json);
return o;
}
</script>
<%
Dim json
json ="{""px_name"":""第二届"",""px_ksjs"":""2014-03-11"",""px_kcfl"":""培训课程""}"
Set json = toObject(json)
Response.Write json.px_name & " <br/>"
Response.Write json.px_ksjs & " <br/>"
Response.Write json.px_kcfl & " <br/>"
Set json = Nothing
%>
3. 如何获取网页中的json数据
1、首先打开你编写网页程序的软件。
4. 如何获得一个页面的json数据
可以用下面代码试试:
public String IP() throws IOException{
String IP=null;
URL url = new URL("http://iframe.ip138.com/ic.asp");
URLConnection conn = url.openConnection();
conn.setRequestProperty(
"User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15");
conn.setRequestProperty("Content-Type", "text/html");
conn.setRequestProperty("Accept",
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
InputStream is = conn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is,
"GB2312"));
String line = null;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
return IP;
}
5. asp如何跨域访问页面 并获取JSON
jsonp
scrpt 标签+iframe动态请求数据 单向
scrpt 标签+window.name 实现跨域访问 双向
scrpt 标签+window.hash 实现跨域 遗留历史访问记录,不安全。 不推荐
6. asp读取并输出json数据中的每个值
可以用ajax,搜索这方面的内容
7. asp页面如何接收ajax传过来的json数据
JS的值是无法直接用ASP获取,JS是属于客户端语言,ASP是服务器端无法直接调用的。
8. post 给asp页面的json数据,asp里面怎么获取啊
方法1
<script language="jscript" runat="server">
var obj = eval("(" + json +")");
// 在此处处理obj 把它放到普通变量或字典对象中
</script>
<script language="vbscript" runat="server">
此处直接调用上述变量
</script>
方法2
复杂点,找一个能解析js 的 COM组件
sJSPath = sPrjPath & "web\js\jsonparser.js"
Set oFS = CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(sJSPath) Then
Set oFile = oFS.OpenTextFile(sJSPath, 1, False, 0)
sJSText = oFile.ReadAll()
oFile.Close
Set oFile = Nothing
End If
Set oHost = CreateObject("newObjects.Scphost.ScpMan2")
With oHost
.LoadEngine "JScript"
.AddText sJSText
.Run()
Set oDic = .script.getDic(sJSON)
End With
Set oHost = Nothing
jsonparser.js
function getDic(s){
var obj = eval("(" + s + ")");
var dic = new ActiveXObject("newobjects.utilctls.VarDictionary");
with(dic){
allowUnnamedValues = true;
allowDuplicateNames = true;
9. asp如何获取ajax()提交的json数据
bytecount = Request.TotalBytes
bytes = Request.BinaryRead(bytecount)
Set stream = Server.CreateObject("ADODB.Stream")
stream.Type = 1 'adTypeBinary
stream.Open()
stream.Write(bytes)
stream.Position = 0
stream.Type = 2 'adTypeText
stream.Charset = "utf-8"
s = stream.ReadText() 'here is your json as a string
stream.Close()
Set stream = nothing
Response.write(s)
得到的s就是json格式的字符串,就象{"userid":"apple","password":"test123456"}
然后再利用其它工具可以将json字符串中的相关信息提取出来。这个网上有很多示例。
10. ASP 中如何在一个页面中获取第二个页面的数值
看了两遍问题还是没明白你的意思,大概猜一下吧.
如果你的C页面是通过INCLUDE指令被包含到B页面的,那么,在INCLUDE指令之前,对a1变量(全局变量)进行赋值,在C里面就可以直接使用.
如果是B处理完以后通过Response.Redirect方法转向C页面的,可以通过URL参数,但不知道你说的(又没法添加“?xx=xx”的参数)是怎么一种情况.但是如果不能用URL参数,还可以通过Session进行变量传递.
最后,你提到的a1是非固定的,这个让人很不理解,如果你说a1的值不固定,这个倒没问题,变量值当然不固定,但如果你说变量名也不固定,也许你只能调用EVal函数来动态获取可能的变量的值了.