在web端定義js方法去接收客戶(hù)端傳遞過(guò)來(lái)的參數(shù),具體就是獲取地址中?后的數(shù)據(jù),各個(gè)參數(shù)用&分割,存儲(chǔ)于數(shù)組中,獲取。
具體如下:
//定義獲取地址中參數(shù)的方法
function GetRequest() {
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
}
}
return theRequest;
}
var Request = new Object();
Request = GetRequest();
var userName = Request['user_name']; //獲取用戶(hù)名稱(chēng)
以上所述是小編給大家介紹的Winform客戶(hù)端向web地址傳參接收參數(shù)的方法的相關(guān)知識(shí),希望對(duì)大家有所幫助