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

ͼƬÎļþÉÏ´«, Éú³É¸ßÖÊÁ¿ËõÂÔͼ (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 ·½·¨±£´æÎ


Ïà¹ØÎĵµ£º

ÔÚASP.NETÖÐÉÏ´«Í¼Æ¬²¢Éú³ÉËõÂÔͼµÄC#Ô´Âë

http://www.knowsky.com/5723.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls; ......

ASP.NET AJAX ʹÓÿͻ§¶Ëµ÷Ó÷þÎñÆ÷¶ËµÄ·½·¨

  Microsoft ASP.NET AJAX¿ÉÒԺܷ½±ãµÄÈÃÎÒÃÇÔÚ¿Í»§¶ËʹÓýű¾µ÷ÓÃASP.NET Web
Services(.asmx),ÒªÆôÓÃÕâÒ»ÌØÐÔ£¬ÏñÇ°ÃæÌáµ½µÄÒ»Ñù£¬±ØÐëÒªÅäÖÃWeb.Config£¬¿ÉÒÔ²ÎÕÕMicrosoft ASP.NET
AJAX°²×°Ä¿Â¼ÏµÄWeb.Config£¬Èç¹ûÊÇͨ¹ýASP.NET AJAX-enabled Web
siteÄ£°æ½¨Á¢µÄÕ¾µã£¬Ôò²»ÐèÒªÔÙ½øÐÐÉèÖÃÁË¡£ÅäÖýڵãÈçÏ ......

ASP.net:Ö§¸¶±¦½Ó¿Ú


Ö§¸¶±¦µÄ½Ó¿Úµ÷Óúܲ»·½±ã£¬¸Õ×öºÃÒ»¸ö·â×°£¬ÊµÏÖÁËÐéÄâ½»Ò׺ÍʵÎï½»Òס£
½â¾ö·½°¸ÖÐÓÐÈý¸öÏîÄ¿ÒÔ¼°NDocÉú³ÉµÄÎĵµ£¬¼òµ¥µÄÐòÁÐͼ£ºCommonAliPay£¬·â×°µÄÖ§¸¶±¦½Ó¿Ú¡£
TestAli,asp.netµÄ²âÊÔÏîÄ¿
TestCommonAliPay£¬NunitµÄ²âÊÔÏîÄ¿¡£
µ÷Ó÷½·¨£º
1¡¢ÒýÈëCommonAliPay.dll
2¡¢ÊµÏÖÖ§¸¶±¦·þÎñ½Ó¿ÚµÄ·½·¨µ÷Ó÷½Ê½£º
......

ASP.NET Ìá½»±íµ¥·½Ê½·¢ËÍÊÖ»ú¶ÌÐÅ

        string FormURL = "http://10.45.19.80:8080/easysendok.jsp";
        //±íµ¥ÐèÒªÌá½»µÄ²ÎÊý
        //sendobj ²ÎÊýΪ½ÓÊÕ¶ÔÏó£¨ÊÖ»úÓû§£©£»sendTextΪ¶ÌÐÅÄÚÈÝ 
   &n ......

ÔÚ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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ