ÔÚASP.NETÖÐʵÏÖÈçºÎÏÂÔØtxt¼°xmlÎļþµÄ·½·¨
string destFileName = "ok.txt";
destFileName = Server.MapPath(".") + "\\"+destFileName;
destFileName = Server.UrlDecode(destFileName);
if (File.Exists(destFileName))
{
FileInfo fi = new FileInfo(destFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(destFileName), System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(destFileName);
Response.Flush();
Response.End();
}
else
&nb
Ïà¹ØÎĵµ£º
Ô´ÌùµØÖ·£ºhttp://www.cnblogs.com/yanyangtian/archive/2009/05/07/1451705.html
ǰÑÔ£ºÒì³£µÄ´¦ÀíÔÚÏîÄ¿¿ª·¢ÖÐÊǺÜÓбØÒªµÄ£¬Òì³£µÄ´¦Àí²»½ö½öÖ»ÊÇtry..catch..finally¾ÍÍêÊÂÁ˵ġ£Òì³£´¦Àí¾ø¶Ô¿ÉÒԳƿª·¢ÖеÄÖØÒª×é³É²¿·Ö¡£±ØÐëÕýÈ·µÄÃæ¶ÔÒì³ ......
string path = "...\\Debug\\log.txt";
if (!File.Exists(path))
& ......
³£Óú¯ÊýϵÁÐ:
public static string Get_ClientIP() µÃµ½¿Í»§¶ËIP
public static string Get_CMac(string IP) µÃµ½¿Í»§¶Ë CMac µØÖ·
public static string RequestF(string xPName,string xPType,int xLenDef) °²È«½ÓÊÕÊý¾ÝϵÁÐ
public static string Show_Cont(string xStr) ¹ýÂËÏÔʾ×Ö´®
public static str ......
ΪʲôҪ״̬¹ÜÀí
B/SÓëC/SÁ½Öּܹ¹µÄÓÐ×ÅÍêÈ«²»Í¬µÄÔËÐлúÖÆ¡£C/S»ù±¾ÉÏËùÓеÄÈí¼þ¹¦Äܶ¼ÔÚ¿Í»§¶Ë(Client)ÖÐʵÏÖ£¨ËùÒÔC/SÒ²³ÆÎªÅÖ¿Í»§¶Ë¼Ü¹¹£©£¬·þÎñÆ÷¶Ë(Server)Ö»Ìṩ»ù´¡·þÎñ£¬×îΪµäÐ͵ÄÊÇÊý¾Ý¿â·þÎñÌṩÊý¾Ý·þÎñ¡£¶øB/S¼Ü¹¹Ö÷ÒªµÄ¹¦ÄÜÔÚ·þÎñ¶Ë(Server)ʵÏÖ£¬¿Í»§¶ËµÄä¯ÀÀÆ÷( ......
Ê×ÏÈÒªÌí¼Ó
using System.Data;
using System.Data.SqlClient;
½ÓÏÂÀ´£º
SqlConnection conn = new SqlConnection("server=QLPC\\SQL2005;uid=sa;pwd=£¨ÄãµÄÃÜÂ룩;database=£¨ÄãµÄÊý¾Ý±í£©"); &n ......