0

私のコードは.......

  string PName = Request.QueryString["ProductName"] as string;
  string myDate = Request.QueryString["period"];

 string sql = "select FileName from tblProduct Where ProductName=" + PName;



    DateTime dt1 = Convert.ToDateTime(myDate);
    DateTime dt2 = DateTime.Now;
    TimeSpan variable = dt2 - dt1;
    if (variable.TotalMinutes > 5)
    {
        //Response.Write("Download time is expired now");
        lblmsg.Visible = true;
        lblmsg.Text = "Download time is expired now";
    }
    else
    {
        //string url1 = " http://www.shreehans.co.in/files/" + PName +"";
        //Response .Redirect ()
        lblmsg.Visible = true;
        lblmsg.Text = "U can Still Download";
    }

そして、私のURlはクエリ文字列パラメータを使用しています......

mail.Body += string.Format("http://www.abc.co.in/Download.aspx?period=" + DateTime.Now + "&ProductName=" + productName + "\">デモ ダウンロード");

4

3 に答える 3

0

これで問題が解決します

mail.Body += 
   string.Format("http://www.abc.co.in/Download.aspx?period=" + 
   DateTime.Now.ToString("dd-MMM-yyyy") + 
   "&ProductName=" + productName + "\">Demo Download"); 
于 2013-04-11T09:38:22.460 に答える
0

加えて:

  1. \"URI の作成時にa がありません。
  2. SQL コードが SQL インジェクション攻撃を受けやすい。
于 2013-04-11T08:38:51.247 に答える