Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NETÔÚ±¾µØ·þÎñÆ÷ÉÏ´´½¨Ä¿Â¼²¢ÔÚ¸ÃĿ¼ÏÂдÎļþ

public static Boolean WriteTextFile(string content, string filepath,string name)
{
FileStream fs;
StreamWriter sw;
if (!System.IO.Directory.Exists(filepath))
{
DirectoryInfo DirInfo = Directory.CreateDirectory(filepath); //´´½¨Ä¿Â¼
DirInfo.Attributes = FileAttributes.Normal;
}
string fullpath = filepath + name + ".txt";
if (File.Exists(fullpath))//ÑéÖ¤ÎļþÊÇ·ñ´æÔÚ
{
return false;
}
else
{
fs = new FileStream(fullpath, FileMode.Create, FileAccess.Write);
sw = new StreamWriter(fs,System.Text.Encoding.Default);
sw.WriteLine(content);
sw.Close();
fs.Close();
return true;
}
}
 ÔÚ×öÕâ¸öÏà¹Ø¹¤×÷µÄʱºò »¹Åöµ½Ò»¸öÎÊÌâ¾ÍÊÇ ÓÃһϷ½·¨¶ÁÈ¡ÖÐÎÄÎı¾Îļþʱ£¬³öÏÖÂÒÂëµÄÏÖÏó£º
public static String ReadTextFile(string filepath)
{
StreamReader objReader = new StreamReader(filepath);
string sLine = "";
ArrayList arrText = new ArrayList();
while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null)
arrText.Add(sLine);
}
objReader.Close();
StringBuilder sb = new StringBuilder();
foreach (string sOutput in arrText)
sb.Append(sOutput);
return sb.ToString();
}
²éѯ×ÊÁÏ ·¢ÏÖ¶ÔÉÏÃæ´úÂëÖеÄStreamReaderÐÞ¸Äһϣ¬ÈçÏ´úÂ룺
public static String ReadTextFile(string filepath)
{
StreamReader objReader = new StreamReader(filepath, System.Text.Encoding.Default);
string sLine = "";
ArrayList arrText = new ArrayList();
while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null)
arrText.Add(sLine);
}
objReader.Close();
S


Ïà¹ØÎĵµ£º

ÔÚasp.net 2.0ÖÐʹÓÃSqlBulkCopyÀàǨÒÆÊý¾Ý

ÎÒÃǾ­³£ÒªÔÚÒ»¸ö±íÖн«Êý¾ÝǨÒƵ½ÁíÒ»¸ö±í£¬µ±È»£¬Óõķ½·¨Ê®·Ö¶àÁË¡£ÔÚ.net 2.0ÖУ¬ÌṩÁËÒ»¸ösqlbulkcopyÀ࣬Ҳ¿ÉÒÔʵÏÖÈçϵIJÙ×÷£¬ÏÂÃæ¼òµ¥½éÉÜÏ¡£±ÈÈçÒ»¸ö±íÈçÏÂ
CREATE TABLE Person3
(
PersonID int IDENTITY(1,1) PRIMARY KEY,
Name nvarchar(200),
Email nvarchar(200),
Picture image
)
INSERT INT ......

ÔÚasp.netÖнÓÊÕsql serverÖд洢¹ý³ÌµÄ·µ»ØÖµ

´æ´¢¹ý³Ì´úÂ룺
create procedure proc_name
   @para1 nchar(20),    --ÊäÈë²ÎÊý
   @para2 int = null output¡¡--Êä³ö²ÎÊý£¬¹©³ÌÐòʹÓÃ
as
begin
   if (@para1='a')
   begin
       insert into employee(name) value ......

ASP.NETÉú³É¾²Ì¬Ò³ÃæµÄ·½·¨

ʹÓÃASP.NETÉú³É¾²Ì¬Ò³ÃæµÄ·½·¨ÓÐÁ½ÖÖ£¬µÚÒ»ÖÖÊÇʹÓÃC#ÔÚºǫ́Ӳ±àÂ룬µÚ¶þÖÖÊǶÁÈ¡Ä£°åÎļþ£¬Ê¹ÓÃ×Ö·û´®Ìæ»»µÄ·½·¨¡£µÚÒ»ÖÖ·½·¨±àÂëÁ¿´ó£¬
¶øÇÒά»¤±È½ÏÀ§ÄÑ¡£ÎÒÖص㽲½âµÚ¶þÖÖ·½·¨¡£µÚ¶þÖÖ·½·¨µÄ»ù±¾Ë¼Â·ÊÇ£ºÊ¹ÓÃDWÖ®ÀàµÄ¹¤¾ßÉú³ÉÒ»¸ö¾²Ì¬Ò³ÃæÄ£°å¡£¶ÁÈ¡¸ÃÄ£°åÎļþ£¬È»ºó¶ÔÀïÃæµÄÌØÊâ±ê¼ÇʹÓÃ
ÕæʵµÄÊý¾ÝÌæ»»µô£¬²¢Éú³ÉÒ ......

asp.net ¼¸ÖÖÒ³Ãæ¼ä´«Öµ·½·¨×ܽá

Ò»¡¢Ä¿Ç°ÔÚASP.NETÖÐÒ³Ãæ´«Öµ¹²ÓÐÕâô¼¸ÖÖ·½Ê½£º
µÚÒ»ÖÖ·½·¨£º
¡¡¡¡Í¨¹ýURLÁ´½ÓµØÖ·´«µÝ
 send.aspx: 
protected void Button1_Click(object sender, EventArgs e)   
 {       
     Request.Redirect("Default2.aspx?usern ......

XPÏÂasp.netÓû§µÄÉèÖÃÎÊÌâ

 1.    ÔÚXPÏ£¬IIS·¢²¼asp.net³ÌÐòʱ£¬ÓÐʱ»áÓöµ½±¨´í“µ±Ç°Óû§ÎÞ·¨·ÃÎÊIISÔªÊý¾Ý¿â”»ò“ASP.NETÓû§ÎÞ·¨·ÃÎÊÖ¸¶¨Ä¿Â¼”£¬ÎÊÌâµÄ½â¾ö·½·¨ÈçÏ£º
       1.ÔÚÄãËùÐèÒª·ÃÎʵÄ×ÊԴĿ¼ÉÏÓÒ¼üÑ¡Ôñ “¹²ÏíºÍ°²È«”£¬È»ºóµã»÷“°²È«”ҳǩ¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ