You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
62 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace SCP.Code
|
|
{
|
|
public class MyQueryStringDeCode
|
|
{
|
|
private List<Arg> args = new List<Arg>();
|
|
public MyQueryStringDeCode()
|
|
{
|
|
try
|
|
{
|
|
string MyQueryString = MyWebRequest.QueryString("s");
|
|
if (MyQueryString != "")
|
|
{
|
|
//MyQueryString = System.Web.HttpUtility.UrlDecode(MyQueryString);
|
|
MyQueryString = DEncrypt.Decrypt(MyQueryString);
|
|
|
|
string[] sp = MyQueryString.Split('&');
|
|
for (int i = 0; i < sp.Length; i++)
|
|
{
|
|
string[] s1 = sp[i].Split('=');
|
|
if (s1.Length == 2)
|
|
{
|
|
Arg arg = new Arg();
|
|
arg.Name = s1[0];
|
|
arg.Value = s1[1];
|
|
args.Add(arg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
throw new Exception("无效URL参数!");
|
|
}
|
|
|
|
}
|
|
|
|
public string QueryString(string Name)
|
|
{
|
|
string Value = "";
|
|
for (int i = 0; i < args.Count; i++)
|
|
{
|
|
if (args[i].Name == Name)
|
|
{
|
|
Value = args[i].Value;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return Value;
|
|
}
|
|
|
|
}
|
|
|
|
public class Arg
|
|
{
|
|
public string Name;
|
|
public string Value;
|
|
}
|
|
}
|
|
|