Response.Redirect用法詳解
The Redirect method causes the browser to redirect the client to adifferent URL.
EG:
string CurrentTime = DateTime.Now.ToShortDateString().ToString();
//其中UserId是從函數外傳遞進去的參數,注意超鏈接需要添加引號,引號內的東西原樣輸出
string MyUrl = "https://www.microsoft.com?UID=" + UserId + "&TYPE &APP&BIZ=" + CurrentTime + "&func=SYS0102";
Response.Redirect(MyUrl);
小注:區別往sql語句中傳遞變量是這種形式'"+CurrentTime+"',而拚接字符串時變量" + CurrentTime + "其中CurrentTime前後的++表示連接,而+前或後的"是對其前後需要連接的字符串用的。
對數據庫裏麵的SQL語句賦值的時候也要用在雙引號裏麵SQL="select a,b,c from ..."
但是SQL語句中會有單引號把字段名引出來
例如:select * from table where user='abc';
這裏的SQL語句可以直接寫成SQL="select * from table where user='abc’"
ANSI/ISO標準規定字符數據的SQL常量要包含在單引號(')內。
最後更新:2017-04-03 12:54:15