Re: [問題] 產出一個.SQL的檔案
protected void Button1_Click(object sender, EventArgs e)
{
Response.ClearHeaders();
Response.Clear();
Response.Expires = 0;
Response.Buffer = true;
Response.AddHeader("Accept-Language", "zh-tw");
Response.AddHeader("content-disposition", "attachment; filename="
+ TextBox1.Text + ".sql");
Response.ContentType = "text/plain";
Response.Write(TextBox1.Text);
Response.End();
}
※ 引述《bigmommom (就知道過得去的!)》之銘言:
: 最近碰觸了ASP.NET和C#,
: 可是公司已經丟了一個題目給我,其中有一題是
: 在我按下BUTTON之後,要抓頁面上的textbox或是其他dropdownlist的資料
: 之後在產生出一個.SQL的檔案,(或是.TXT的文字檔之類的)
: 而且可以存在USER的電腦上,或是另存新檔的功能…
: 因為之前沒碰過…完全不知道關鍵字該選哪個…囧
: 也不知道怎麼查msdn…囧!
: 所以可以問看看版上的神手們…這該怎麼寫呢?
--
推
08/26 02:51,
08/26 02:51
推
08/26 02:54,
08/26 02:54
→
08/26 02:56,
08/26 02:56
推
08/26 02:57,
08/26 02:57
推
08/26 03:12,
08/26 03:12
推
08/26 03:14,
08/26 03:14
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.193.64
推
12/25 15:26, , 1F
12/25 15:26, 1F
你自己試試看不就知道了嗎
※ 編輯: ken1325 來自: 118.168.193.64 (12/25 16:31)
→
12/25 17:17, , 2F
12/25 17:17, 2F
→
12/25 17:17, , 3F
12/25 17:17, 3F
→
12/25 17:18, , 4F
12/25 17:18, 4F
把textbox的內容另存新檔不是嗎?
※ 編輯: ken1325 來自: 118.168.193.64 (12/25 17:41)
討論串 (同標題文章)