1、鏈接例子: string url = "http://domainName:port/1/2/3/4.htm?sysCode=1001020&token=QXJzemR3YXlWdm9YMFhneFU0c2tqSXp6YmJqMVNQSUVlWndEbm9yellBNHp5SXBmK2gxVGx ...
1、鏈接例子:
string url = "http://domainName:port/1/2/3/4.htm?sysCode=1001020&token=QXJzemR3YXlWdm9YMFhneFU0c2tqSXp6YmJqMVNQSUVlWndEbm9yellBNHp5SXBmK2gxVGxGT1NBdVhkd3dTWTFQdG1xajBPV1FmRWVSRStBRTVMSFpCdkZRdEFaQ25KVCtxOWRITTk5bEczYW1KL0N0cUtEamdheHBaU3ZFRGRacDh5NGc1TEF0cDkrUGQrUGEwazhoc0Qzc1BaUFdkRXM1aEQ3SzVyNmEzcDdhVUZlWVU5SlNwdmdNQ0N3anJUaTR6SS9USEltWXZuSGEwVVZPNFVhdzUyZFRPWC8zbk42VWpWZDNZdTU5bERqcHBYalpvY0ZXMHJnS08zWFZadEZUUEdKdDIrVTNWTklHb1psZE9Gc0cwVElzTVZNL3NkR1NiSGVuS3B2aXlFMEx3cngxOXJuZTVSSEVNY0VyNGJGNDlYNDhnSXVJc2NVRUZMbzA2ZVdpWWFGT21SV1BhOGpqbURDcHdQN1JjPQ==";
if (url.Contains("?"))
{
string[] separateURL = url.Split('?');
System.Collections.Specialized.NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString(separateURL[1]);
tokenStr = queryString["token"];
}
這是針對傳過來的就是字元串形式的鏈接
2、後臺控制器直接獲取前臺鏈接的token
var str = Request.QueryString["token"];