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

Asp.net¶ÔÎļþ¼ÐºÍÎļþµÄ²Ù×÷Àà

using System;
using System.IO;
using System.Web;
namespace SEC
{
/**////
/// ¶ÔÎļþºÍÎļþ¼ÐµÄ²Ù×÷Àà
///
public class FileControl
{
public FileControl()
{
}
/**////
/// ÔÚ¸ùĿ¼Ï´´½¨Îļþ¼Ð
///
///
Òª´´½¨µÄÎļþ·¾¶
public void CreateFolder(string FolderPathName)
{
if(FolderPathName.Trim().Length> 0)
{
try
{
string CreatePath = System.Web.HttpContext.Current.Server.MapPath
("../../../Images/"+FolderPathName).ToString();
if(!Directory.Exists(CreatePath))
{
Directory.CreateDirectory(CreatePath);
}
}
catch
{
throw;
}
}
}
/**////
/// ɾ³ýÒ»¸öÎļþ¼ÐÏÂÃæµÄ×ÖÎļþ¼ÐºÍÎļþ
///
///
public void DeleteChildFolder(string FolderPathName)
{
if(FolderPathName.Trim().Length> 0)
{
try
{
string CreatePath = System.Web.HttpContext.Current.Server.MapPath
(FolderPathName).ToString();
if(Directory.Exists(CreatePath))
{
Directory.Delete(CreatePath,true);
}
}
catch
{
throw;
}
}
}
/**////
/// ɾ³ýÒ»¸öÎļþ
///
///
public void DeleteFile(string FilePathName)
{
try
{
FileInfo DeleFile = new FileInfo(System.Web.HttpContext.Current.Server.MapPath
(FilePathName).ToString());
DeleFile.Delete();
}
catch
{
}
}
public void CreateFile(string FilePathName)
{
try
{
//´´½¨Îļþ¼Ð
string[] strPath= FilePathName.Split('/');
CreateFolder(FilePathName.Replace("/" + strPath[strPath.Length-1].ToString(),"")); //´´½¨Îļþ
¼Ð
FileInfo CreateFile =new FileInfo(System.Web.HttpContext.Current.Server.MapPath
(FilePathName).ToString()); //´´½¨Îļþ
if(!CreateFile.Exists)
{
FileStream FS=CreateFile.Create();
FS.Close();
}
}
catch
{
}
}
/**////
/// ɾ³ýÕû¸öÎļþ¼Ð¼°Æä×ÖÎļþ¼ÐºÍÎļþ
///
///
public void DeleParentFolder(string FolderPathName)
{
try
{
DirectoryInfo DelFolder = new DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath
(FolderPathName).ToString());
if(DelFolder.Exists)
{
DelFolder.Delete();
}


Ïà¹ØÎĵµ£º

ASP.NETµÄACCESSÊý¾Ý¿â²Ù×÷Àà

//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ· 
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ· 
/// 
/// È¡µÃdataset 
// 
/// ²éѯÓï¾ä 
/// 
public DataSet GetDataSet(string Commandtext) 
{&nbs ......

asp.netÖÐ'***\ASPNET' µÇ¼ʧ°ÜµÄÔ­ÒòÓë½â¾ö°ì·¨

1¡¢Èç¹ûÕâÖÖÇé¿ö³öÏÖÔÚ±¾»ú£¬ÔòÔÚsql server µÄÆóÒµ¹ÜÀíÆ÷µÄ¿ØÖÆ̨Ŀ¼ÀïÑ¡ÔñÏàÓ¦µÄÊý¾Ý¿â£¬ÔÚÆäϵÄÓû§½ÚµãµãÓÒ¼üн¨Êý¾Ý¿âÓû§£¬½«***\ASPNETÓû§¼ÓÈ룬²¢¸³ÓèpublicȨÏÞ¡£
2¡¢Èç¹û³öÏÖÔÚÆäËûµÄµçÄÔ£¬Ôò¼ì²é ³ÌÐòÁ¬½ÓSQLServerµÄÁ¬½Ó×Ö·û´®ÊDz»ÊÇÓÃÁËwindows¼¯³ÉµÇ½£¬Ò»°ã³öÏÖ´ËÎÊÌâµÄ×´¿ö¶¼ÊÇÒòΪʹÓÃÁËwindows¼¯³Éµ ......

asp.netÎļþºÍÎļþ¼ÐѹËõ

·¨Ò»£ºµ÷ÓÃwinrar
using Microsoft.Win32;
using System.Diagnostics;
protected void Button1_Click(object sender, EventArgs e)
    {
        RAR(@"E:\95413594531\GIS", "tmptest", @"E:\95413594531\");
    }
    /// < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ