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"];