日期:2014-05-18  浏览次数:20440 次

ASP.NET调用迅雷问题!!
在获取信息时:
BSTR GetInfo(BSTR pInfoName) 
功能:获得迅雷或平台相关信息 
参数: 
参数名 含义 
pInfoName 信息名称,有如下4种 
。“ThunderExists”:迅雷是否存在 
。“ThunderRunning”:迅雷是否运行 
。“ThunderVersion”:迅雷版本号 
。“PlatformVersion”:平台版本号  

这个时什么意思【BSTR GetInfo(BSTR pInfoName)】 ?
[BSTR]如何得来?






------解决方案--------------------
<script runat=server>
public string ThunderEncode(string code) 

code="AA"+code+"ZZ"; 
string encode = ""; 
byte[] bytes = Encoding.GetEncoding(gb2312).GetBytes(code); 
try 

encode = Convert.ToBase64String(bytes);

catch 

encode = code; 

return "thunder://"+encode; 
}
</script>

<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>
<a href="#" thunderHref="<%=ThunderEncode("资源实际下载")%>" thunderPid="你的联盟号" thunderType="" thunderResTitle="" onClick="return OnDownloadClick_Simple(this,2)" oncontextmenu="ThunderNetwork_SetHref(this)" >迅雷专用高速下载</a>

代码详细说明:

1.<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>这句是调用我们服务器上的js文件,主要作用是判断用户是否已经安装了迅雷5或者web迅雷。

2.ThunderEncode("资源实际下载")这里填入你的资源的实际下载地址(如:你的资源的实际下载地址是downloadurl这个变量,你就必须改为ThunderEncode(downloadurl))。

3.thunderPid="你的联盟号"这个改为你自己的联盟号。(如:thunderPid="00390")。

4.“迅雷专用高速下载”这几个字就是显示在你的页面上的文字,你可以设置这个字体的大小和颜色,当然也可以换成你自己喜欢的图片。
------解决方案--------------------
学习
------解决方案--------------------
关注~~~~