ͼƬÎļþÉÏ´«, Éú³É¸ßÖÊÁ¿ËõÂÔͼ (asp.net c#)
ºǫ́´úÂ룺
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
public partial class User_UpLoadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void UPbutton_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileContentType = FileUpload1.PostedFile.ContentType;
if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg")
{
string name = FileUpload1.PostedFile.FileName; // ¿Í»§¶ËÎļþ·¾¶
FileInfo file = new FileInfo(name);
string SavePath = "/upload/";
string fileExes = (System.IO.Path.GetExtension(name)).ToString().ToLower();//ÎļþÀ©Õ¹Ãû
Random ran = new Random();
int RandKey = ran.Next(9, 999);//ran.Next(start,end)
string fileName = "P" + System.DateTime.Now.ToString("yyMMddhhmm") + RandKey + fileExes;
string fileName_s = "S" + fileName.Substring(1); // ËõÂÔͼÎļþÃû³Æ
//string fileName_sy = "sy_" + file.Name; // ˮӡͼÎļþÃû³Æ£¨ÎÄ×Ö£©
//string fileName_syp = "syp_" + file.Name; // ˮӡͼÎļþÃû³Æ£¨Í¼Æ¬£©
string webFilePath = Server.MapPath(SavePath + fileName); // ·þÎñÆ÷¶ËÎļþ·¾¶
string webFilePath_s = Server.MapPath(SavePath + fileName_s); // ·þÎñÆ÷¶ËËõÂÔͼ·¾¶
//string webFilePath_sy = Server.MapPath("/upload/" + fileName_sy); // ·þÎñÆ÷¶Ë´øˮӡͼ·¾¶(ÎÄ×Ö)
//string webFilePath_syp = Server.MapPath("/upload/" + fileName_syp); // ·þÎñÆ÷¶Ë´øˮӡͼ·¾¶(ͼƬ)
//string webFilePath_sypf = Server.MapPath("/upload/shuiyin.jpg"); // ·þÎñÆ÷¶Ëˮӡͼ·¾¶(ͼƬ)
if (!File.Exists(webFilePath))
{
try
{
FileUpload1.SaveAs(webFilePath); // ʹÓà SaveAs ·½·¨±£´æÎ
Ïà¹ØÎĵµ£º
Microsoft ASP.NET AJAX¿ÉÒԺܷ½±ãµÄÈÃÎÒÃÇÔÚ¿Í»§¶ËʹÓýű¾µ÷ÓÃASP.NET Web
Services(.asmx),ÒªÆôÓÃÕâÒ»ÌØÐÔ£¬ÏñÇ°ÃæÌáµ½µÄÒ»Ñù£¬±ØÐëÒªÅäÖÃWeb.Config£¬¿ÉÒÔ²ÎÕÕMicrosoft ASP.NET
AJAX°²×°Ä¿Â¼ÏµÄWeb.Config£¬Èç¹ûÊÇͨ¹ýASP.NET AJAX-enabled Web
siteÄ£°æ½¨Á¢µÄÕ¾µã£¬Ôò²»ÐèÒªÔÙ½øÐÐÉèÖÃÁË¡£ÅäÖýڵãÈçÏ ......
Ó¦ÓóÌÐò£¬´°ÌåÀïÍÏ·ÅÒ»¸öTreeView¿Ø¼þ£¬Ïë°ÑÊý¾Ý¿âÀïµÄÊý¾ÝÔÚÕâ¸ö¿Ø¼þÀïÏÔʾ³öÀ´
TREEVIEW¿Ø¼þÊÇWinfrom´°ÌåÀïµÄ ²»ÊÇASP£®NETÀïµÄTREEVIEW
´úÂëÈçÏ£º
CREATE TABLE CateTable (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[CateName] [nv ......
ÔÎÄ http://www.886s.com/blog/?p=96
Ëæ×ÅAjaxµÄÊ¢ÐУ¬´ó¼Ò¶¼È¥´ÕÈÈÄÖ£¬ÎÒÃǵÄÏîÄ¿Ò²²»ÀýÍâ¡£
¿´ÁËÒ»ÏÂÏÖÓеĴúÂ룬¶ÔÓÚÒ»¸ö²Ù×÷³éÈ¡Ò»¸öµÄÒ³Ã棬°Ñ²ÎÊý½ÓÊÕ£¬µ÷ÓÃÂß¼²ãµÄÏà¹Øº¯Êý²¢·µ»ØÏàÓ¦µÄJson»òÕßXml£¬ËÑË÷ÁËһϣ¬¹¤³ÌÖо¹È»ÓÐÁË360+¸öÕâÖÖÒ³Ã棬ÕâÕæÊÇÒ»ÖÖÀË·Ñ£¡Èç¹ûÓ÷´É䣬һ¸öÒ³Ãæ¾Í¿ÉÒԸ㶨£¡½ÚÊ¡Á˶àÉ ......
µÚ1ÖÖ.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing ......