Asp.NetÎļþÉÏ´«
ÓÃAsp.NetÉÏ´«Îļþ,Ê×Óõ½µÄÊÇFileUpload¿Ø¼þ
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:Button ID="btn" runat="server" Text="È·¶¨" OnClick="btn_Click"/>
C#´úÂë
protected void btn_Click(object sender, EventArgs e)
{
//ÅжÏÊÇ·ñÑ¡ÔñÁËÎļþ
if (this.FileUpload1.HasFile)
{
try{
//»ñÈ¡Îļþ
HttpPostedFile filename = this.FileUpload1.PostedFile;
//ÅжÏÎļþ´óС,×Ö½ÚΪµ¥Î»
if (filename.ContentLength>0)
{
FileUpload1.SaveAs(@"D:\" + FileUpload1.FileName);
s_alert("ÉÏ´«³É¹¦");
}
}
catch (Exception ex)
{
s_alert ("ÉÏ´«Ê§°Ü,³öÏÖ´íÎó");
}
}
else
{
s_alert("Ä㻹ûÓÐÑ¡ÔñÎļþ");
}
}
public static void s_alert(string str)
{
Page page = (Page)HttpContext.Current.Handler;
page.ClientScript.RegisterStartupScript(page.GetType(), Guid.NewGuid().ToString(), "alert('" + str + "');", true);
}
Ïà¹ØÎĵµ£º
1¡¢½¨Á¢Êý¾Ý²ã Á¬½ÓÊý¾Ý¿â->½¨Á¢Êý¾Ý¼¯*.xsd->±íÖн¨Á¢²éѯ·½·¨
2¡¢½¨Á¢ÒµÎñÂß¼²ã °ü×°TableAdapter·½·¨³ÉÀà
3¡¢½¨Á¢Ä¸°åÒ³ºÍÕ¾µãµ¼º½£¨ CSS´ýѧϰ£©
4¡¢Ê¹ÓÃÊý¾ÝÔ´Õ¹ÏÖÊý¾Ý ÎåÖÖÊý¾ÝÔ´ ±à¼Êý¾ÝÔ´²ÎÊý ʹÓÃtableadapter·½·¨
5¡¢Ê¹ÓÃdropDownList¹ýÂËÖ÷-´Ó±¨±í
ʹÓÃtableadapter·½·¨ ......
1.5.2 ÔÚIISÉÏÅäÖÃASP.NET
ÔÚ·þÎñÆ÷Éϲ¿ÊðASP.NETÍøվʱ£¬ÐèÒª.NETµÄÔËÐл·¾³.NET Framework¡£.NET FrameworkÀàËÆÓÚJavaµÄJDK£¬°üº¬ÓÐ.NET³ÌÐòÔËÐл·¾³ºÍÃüÁîÐбàÒ빤¾ß¡£Èç¹û·þÎñÆ÷ÉÏûÓа²×°.NET Framework£¬Õâ¾ÍÐèÒª´Ó΢ÈíÍøÕ¾ÏÂÔØ£¬ÏÂÔØÍøÖ·ÊÇ£º
http://msdn2.microsoft.com/zh-cn/default.aspx
»¹ÐèҪעÒâµÄÊÇ£¬Èç¹ ......
Ò³ÃæÊä³ö»º´æ×÷Ϊ×î¼òµ¥µÄ»º´æÐÎʽ£¬Êä³ö»º´æÖ»ÊÇÔÚÄÚ´æÖб£ÁôΪÏìÓ¦ÇëÇó¶ø·¢Ë굀 HTML µÄ¸±±¾¡£ÆäºóÔÙÓÐÇëÇóʱ½«Ìṩ»º´æµÄÊä³ö£¬Ö±µ½»º´æµ½ÆÚ£¬ÕâÑù£¬ÐÔÄÜÓпÉÄܵõ½ºÜ´óµÄÌá¸ß£¨È¡¾öÓÚÐèÒª¶àÉÙ¿ªÏúÀ´´´½¨ÔʼҳÃæÊä³ö - ·¢ËÍ»º´æµÄÊä³ö×ÜÊǺܿ죬²¢ÇұȽ ......