锘??xml version="1.0" encoding="utf-8" standalone="yes"?>一级日本不卡的影视,欧美日韩国产精品专区,日韩电影在线观看完整版http://www.aygfsteel.com/freebird/category/29499.html錛嶏紞錛嶏紞鎴戝枩嬈㈢殑瀛︿範璧勬枡鏀惰棌鐨勫疂鍦幫紝瀛︿範絎旇鐨勮褰曞満鍦幫紝浜ゆ祦鐨勪箰鍥?/description>zh-cnMon, 18 Feb 2008 17:32:42 GMTMon, 18 Feb 2008 17:32:42 GMT60鍦ˋSP.NET涓笅杞絋ext鏂囦歡錛岃屼笉鏄湪嫻忚鍣ㄤ腑鎵撳紑瀹?杞?http://www.aygfsteel.com/freebird/archive/2008/02/18/180460.htmlfreebirdfreebirdMon, 18 Feb 2008 06:32:00 GMThttp://www.aygfsteel.com/freebird/archive/2008/02/18/180460.htmlhttp://www.aygfsteel.com/freebird/comments/180460.htmlhttp://www.aygfsteel.com/freebird/archive/2008/02/18/180460.html#Feedback0http://www.aygfsteel.com/freebird/comments/commentRss/180460.htmlhttp://www.aygfsteel.com/freebird/services/trackbacks/180460.html 浠嬬粛

璁╃敤鎴蜂粠鎴戜滑鐨勭綉绔欎笂涓嬭澆鍚勭綾誨瀷鐨勬枃浠舵槸涓涓瘮杈冨父鐢ㄧ殑鍔熻兘錛岃繖綃囨枃绔犲氨鏄憡璇夋偍濡備綍鍒涘緩涓涓?txt鏂囦歡騫惰鐢ㄦ埛涓嬭澆銆?/font>

浣跨敤浠g爜

铏界劧鍦ㄧず渚嬮噷錛屾垜鍏堝垱寤轟簡涓涓猼ext鏂囦歡錛屼絾鏄綘涓嶄竴瀹氫篃瑕佽繖涔堝仛錛屽洜涓鴻繖涓枃浠跺彲鑳藉湪浣犵殑緗戠珯閲屽凡緇忓瓨鍦ㄤ簡銆傚鏋滄槸榪欐牱鐨勮瘽錛屼綘鍙渶瑕佷嬌鐢‵ileStream鍘昏鍙栧畠灝卞彲浠ヤ簡銆?/font>

棣栧厛錛屾垜浠皢榪欎釜text鏂囦歡璇誨彇鍒頒竴涓猙yte鏁扮粍涓紝鐒跺悗浣跨敤Response瀵硅薄灝嗘枃浠跺啓鍒板鎴風灝卞彲浠ヤ簡銆?/font>

Response.AddHeader("Content-disposition", "attachment; filename=" + sGenName);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(btFile);
Response.End();


榪欐浠g爜鏄畬鎴愯繖涓姛鑳界殑涓昏浠g爜銆傜涓鍙ュ湪杈撳嚭涓坊鍔犱簡涓涓狧eader錛屽憡璇夋祻瑙堝櫒鎴戜滑鍙戦佺粰瀹冪殑鏄竴涓檮浠剁被鍨嬬殑鏂囦歡銆傜劧鍚庢垜浠緗緭鍑虹殑ContentType鏄?application/octet-stream"錛屽嵆鍛婅瘔嫻忚鍣ㄨ涓嬭澆榪欎釜鏂囦歡錛岃屼笉鏄湪嫻忚鍣ㄤ腑鏄劇ず瀹冦?br />
涓嬮潰鏄竴涓狹IME綾誨瀷鐨勫垪琛ㄣ?/div>
".asf" = "video/x-ms-asf"
".avi" = "video/avi"
".doc" = "application/msword"
".zip" = "application/zip"
".xls" = "application/vnd.ms-excel"
".gif" = "image/gif"
".jpg"= "image/jpeg"
".wav" = "audio/wav"
".mp3" = "audio/mpeg3"
".mpg" "mpeg" = "video/mpeg"
".rtf" = "application/rtf"
".htm", "html" = "text/html"
".asp" = "text/asp"

'鎵鏈夊叾瀹冪殑鏂囦歡
= "application/octet-stream"

涓嬮潰鏄竴涓畬鏁寸殑濡備綍涓嬭澆鏂囨湰鏂囦歡鐨勭ず渚嬩唬鐮?br />C#
protectedvoid Button1_Click(object sender, EventArgs e)
{
string sFileName = System.IO.Path.GetRandomFileName();
string sGenName = "Friendly.txt";
//YOu could omit these lines here as you may not want to save the textfile to the server
//I have just left them here to demonstrate that you could create the text file
using (System.IO.StreamWriter SW = new System.IO.StreamWriter(Server.MapPath("TextFiles/" + sFileName + ".txt")))
{
SW.WriteLine(txtText.Text);
SW.Close();
}

System.IO.FileStream fs = null;
fs = System.IO.File.Open(Server.MapPath("TextFiles/" + sFileName + ".txt"), System.IO.FileMode.Open);
byte[] btFile = newbyte[fs.Length];
fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
fs.Close();
Response.AddHeader("Content-disposition", "attachment; filename=" + sGenName);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(btFile);
Response.End();
}

VB.NET
Dim strFileName AsString = System.IO.Path.GetRandomFileName()
Dim strFriendlyName AsString = "Friendly.txt"

Using sw AsNew System.IO.StreamWriter(Server.MapPath("TextFiles/" + strFileName + ".txt"))
sw.WriteLine(txtText.Text)
sw.Close()
EndUsing

Dim fs As System.IO.FileStream = Nothing


fs = System.IO.File.Open(Server.MapPath("TextFiles/" + strFileName + ".txt"), System.IO.FileMode.Open)
Dim btFile(fs.Length) AsByte
fs.Read(btFile, 0, fs.Length)
fs.Close()
With Response
.AddHeader("Content-disposition", "attachment;filename=" & strFriendlyName)
.ContentType = "application/octet-stream"
.BinaryWrite(btFile)
.End()
EndWith
灝忕粨
浣跨敤榪欎釜鏂規硶錛屼綘鍙互瀹炵幇鍦╓indows緋葷粺涓嬩笅杞芥墍鏈夌殑鏂囦歡綾誨瀷銆備絾鏄湪Macintosh緋葷粺涓嬩細鏈変簺闂銆?/font>


freebird 2008-02-18 14:32 鍙戣〃璇勮
]]> 主站蜘蛛池模板: 葵青区| 仁布县| 永新县| 广灵县| 平潭县| 加查县| 岱山县| 新营市| 雷州市| 灵台县| 西宁市| 稷山县| 佛山市| 镇安县| 西华县| 沙湾县| 信宜市| 芒康县| 内丘县| 海盐县| 石狮市| 静安区| 通榆县| 黔南| 沙雅县| 合阳县| 大埔县| 江西省| 利辛县| 吉林省| 绥江县| 丰县| 江达县| 杭州市| 新津县| 阿坝| 北海市| 通山县| 昭苏县| 汤原县| 原阳县|