62,046
社区成员
发帖
与我相关
我的任务
分享
string strSql = "select col1,col2,col3 from t_name where pram1=1 and pram2=中文 and pram3=类型 and pram4=哈哈";
public static string getHeadTail(String url)
{
System.Net.WebResponse wr_result = null;
StringBuilder txthtml = new StringBuilder();
try
{
System.Net.WebRequest wr_req = System.Net.WebRequest.Create(url);
wr_result = wr_req.GetResponse();
System.IO.Stream ReceiveStream = wr_result.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("gb2312");
System.IO.StreamReader sr = new System.IO.StreamReader(ReceiveStream, encode);
if (true)
{
Char[] read = new Char[256];
int count = sr.Read(read, 0, 256);
while (count > 0)
{
String str = new String(read, 0, count);
txthtml.Append(str);
count = sr.Read(read, 0, 256);
}
}
}
finally
{
if (wr_result != null)
{
wr_result.Close();
}
}
return txthtml.ToString();
}
string commandText = "select * from TableName where 1=1";
string[] arrStr = str.Split('&');
for (int i = 0; i < arrStr.Length; i++)
{
commandText = commandText + " and " + arrStr[i];
}
Response.Write(commandText);
foreach (string str in Request.QueryString.Keys)
{
switch (str)
{
case "pram1":
break;
.......
}
}