天天看點

Response.Redirect用法詳解

browser to redirect the client to adifferent url.

eg:

   string currenttime = datetime.now.toshortdatestring().tostring();

   //其中userid是從函數外傳遞進去的參數,注意超連結需要添加引号,引号内的東西原樣輸出

   string myurl = "http://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常量要包含在單引号(')内。