- 浏览: 618652 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (314)
- 生活 (2)
- c# (37)
- 技术 (3)
- 400电话 (0)
- 400常见问题 (0)
- 400资费 (0)
- html (7)
- css (0)
- 数据库 (7)
- javascript (16)
- php (33)
- asp.net mvc2 (10)
- mysql (9)
- C# 3.0 LinQ (10)
- vs2005或vs2008 (4)
- flash and as3 (7)
- fms (1)
- dedeCMS (11)
- java (33)
- j2me (1)
- swing (1)
- c++ (1)
- jquery easyui (3)
- jquery (5)
- android (29)
- MongoDB (9)
- VtigerCRM (1)
- test (0)
- linux (30)
- nutch (2)
- SqlServer数据库 (2)
- 数据检索 (2)
- java抓取 (11)
- 乐天 (1)
- 淘宝 (1)
- Silverlight4.0 (6)
- sphinx实时索引 (5)
- ecshop (9)
- codeigniter(CI) (3)
- axure6 (1)
- 京东店铺装修教程 (2)
- xpath (1)
- joomla (2)
- bpm (1)
- Bootstrap (2)
- knockout (4)
- ecstore (4)
- css3 (1)
- 微信 (2)
- dede (0)
- soa_edi (1)
- odoo (0)
- web (1)
最新评论
-
骑着蜗牛超F1:
在ie6下报了个stack overflow at line ...
兼容ie6和ie7 的16进制码流在html中显示为图片代码(base64) -
冰之海洋:
好像少了一句代码吧? FloatingFunc.show(th ...
android 一直在最前面的浮动窗口效果 -
yanzhoupuzhang:
连接有问题!
iis7.0官方下载 IIS 7.0(微软Web服务器组件IIS 7.0) 官方(windows 2003,XP,2000) -
whatable:
唉,楼主你都没有搞清楚重量级和轻量级。。。。既然引用了SWT, ...
java swing 内置浏览器打开网页显示flash图表-swt Browser应用 -
yy_owen:
我晕啊,你链接的什么内容额,我要的iis,你链接个视频什么意思 ...
iis7.0官方下载 IIS 7.0(微软Web服务器组件IIS 7.0) 官方(windows 2003,XP,2000)
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.IO;
using System.Text;
public partial class Default5 : System.Web.UI.Page
{
private FileStream fs;
private StreamWriter sw;
private DirectoryInfo di;
private FileInfo fi;
protected void Page_Load(object sender, EventArgs e)
{
string fpath = Server.UrlDecode(Request.QueryString["url"]);
string fname = Server.UrlDecode(Request.QueryString["fname"]);
string ax = Server.UrlDecode(Request.QueryString["ax"]);
Session["fpath"] = fpath;
Session["lastfpath"] = Directory.GetParent(fpath).FullName;
if (!IsPostBack)
{
switch (ax)
{
case "editfile":
Panel1.Visible = true;
editfile(fpath, fname);
break;
case "editdir":
Panel2.Visible = true;
editdir(fname);
break;
case "deletedir":
Panel3.Visible = true;
deletedir(fname);
break;
case "deletefile":
Panel4.Visible = true;
deletefile(fname);
break;
case "movefile":
Panel5.Visible = true;
movefile(fname,fpath);
break;
case "movedir":
Panel6.Visible = true;
movedir(fname,fpath);
break;
case "copyfile":
Panel7.Visible = true;
copyfile(fpath);
break;
case "copydir":
Panel8.Visible = true;
copydir(fpath);
break;
}
}
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
}
protected void editfile(string fpath,string fname)
{
TextBox1.Text=fname;
TextBox2.Text = File.ReadAllText(fpath, Encoding.Default);
}
protected void Button1_Click(object sender, EventArgs e)
{
fs = new FileStream(Session["fpath"].ToString(), FileMode.Create, FileAccess.Write);
sw = new StreamWriter(fs, Encoding.Default);
sw.WriteLine(TextBox2.Text);
sw.Close();
fs.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Default4.aspx?fpath="+Session["lastfpath"].ToString());
}
protected void Button3_Click(object sender, EventArgs e)
{
di = new DirectoryInfo(Session["fpath"].ToString());
string newpath = Session["lastfpath"].ToString() + "\\" + TextBox3.Text;
di.MoveTo(newpath);
}
protected void editdir(string fname)
{
Label1.Text = fname;
}
protected void deletedir(string fname)
{
Label2.Text = fname;
}
protected void deletefile(string fname)
{
Label3.Text = fname;
}
//http://www.my400800.cn
protected void Button5_Click(object sender, EventArgs e)
{
di = new DirectoryInfo(Session["fpath"].ToString());
di.Delete();
Response.Write("<script>alert('成功删除')</script>");
Response.Redirect("Default4.aspx?fpath=" + Session["lastfpath"].ToString());
}
protected void Button7_Click(object sender, EventArgs e)
{
fi = new FileInfo(Session["fpath"].ToString());
fi.Delete();
Response.Write("<script>alert('成功删除')</script>");
Response.Redirect("Default4.aspx?fpath=" + Session["lastfpath"].ToString());
}
protected void movefile(string fname,string fpath)
{
Label5.Text = fname;
Label4.Text = Session["lastfpath"].ToString();
TextBox4.Text = Session["lastfpath"].ToString();
}
protected void movedir(string fname, string fpath)
{
Label6.Text = fname;
Label7.Text = Session["lastfpath"].ToString();
TextBox5.Text = Session["lastfpath"].ToString();
}
protected void Button9_Click(object sender, EventArgs e)
{
fi = new FileInfo(Session["fpath"].ToString());
string newfpath =TextBox4.Text+"\\"+Label5.Text
;
fi.MoveTo(newfpath);
Response.Redirect("Default4.aspx?fpath=" +TextBox4.Text);
}
protected void Button11_Click(object sender, EventArgs e)
{
di = new DirectoryInfo(Session["fpath"].ToString());
string newfpath =TextBox5.Text+"\\"+Label6.Text
;
di.MoveTo(newfpath);
Response.Redirect("Default4.aspx?fpath=" +TextBox5.Text);
}
protected void copyfile(string fpath)
{
Label8.Text = fpath;
TextBox6.Text = fpath;
}
protected void Button13_Click(object sender, EventArgs e)
{
fi = new FileInfo(Label8.Text);
fi.CopyTo(TextBox6.Text);
Response.Redirect("Default4.aspx?fpath=" + TextBox6.Text.Substring(0,TextBox6.Text.LastIndexOf("\\")+1
));
}
protected void copydir(string fpath)
{
Label9.Text = fpath;
TextBox7.Text = fpath;
}
protected void Button15_Click(object sender, EventArgs e)
{
dirCopy(Label9.Text,TextBox7.Text);
Response.Redirect("Default4.aspx?fpath="+TextBox7.Text.Substring(0,TextBox7.Text.LastIndexOf("\\")+1
));
}
protected void dirCopy(string oldpath,string newpath)
{
di = new DirectoryInfo(oldpath);
foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
{
if(fsi is FileInfo)
{
fi = (FileInfo)fsi;
if(!Directory.Exists(newpath))
{
DirectoryInfo newDir= Directory.CreateDirectory(newpath);
fi.CopyTo(newDir.FullName+"\\"+fi.Name
);
}
else
{
fi.CopyTo(newpath+"\\"+fi.Name
);
}
}
else
{
DirectoryInfo child_di=(DirectoryInfo)fsi;
string olddir=child_di.FullName;
string dirname=child_di.FullName.Substring(child_di.FullName.LastIndexOf("\\")+1
);
string newchildpath=Path.Combine(newpath,dirname);
if(!Directory.Exists(olddir))
Directory.CreateDirectory(olddir);
dirCopy(olddir,newchildpath);
}
}
}
}
发表评论
-
Java和C#运行命令行并获取返回值 运行bat文件
2015-08-04 10:45 1268Java运行命令行的例子 import java.io.B ... -
c#操作excel后关闭excel.exe的方法
2013-04-10 10:47 865。网上的一种说法,关闭range,关闭worksheet,关 ... -
ddd
2012-05-24 17:30 0CREATE TABLE IF NOT EXISTS `s ... -
C#里 如何序列化与反序列化 hashtable Dictionary及C#连接mysql数据库
2011-08-19 13:24 1328using System.IO; using System. ... -
C# 压缩和解压web空间中的所有文件
2011-08-18 17:20 840using System; using ICSharpC ... -
C# 压缩和解压web空间中的所有代码
2011-08-18 17:17 640using System; using ICSharpCod ... -
自己制作软键盘的几个关键技术解析
2011-05-26 08:40 1027在嵌入式应用和一些安全软件中经常需要不通过物理键盘输入,虽然微 ... -
rtertert
2011-03-22 17:29 0fffffffffffffffffffffffff ... -
C#发送邮件时在正文中插入图片(邮件中直接包含图片)
2011-01-17 16:12 2348#region 发送邮件 ... -
c#生成Excel,可建立sheet,设定sheet名称,调整列宽度
2010-12-17 16:18 2660Excel生成类 ExcelRW.cs usin ... -
关于AutoResetEvent的使用
2010-12-16 17:21 893AutoResetEvent 允许线程通过发信号互相通信。 ... -
C# 取得函数的调用关系
2010-11-25 08:47 1545如何取得C ... -
iis7.0官方下载 IIS 7.0(微软Web服务器组件IIS 7.0) 官方(windows 2003,XP,2000)
2010-11-18 09:47 91265iis7.0官方安装包下载 iis7时微软为新一代web服务 ... -
简易的文件磁盘管理操作2(文件、文件夹的编辑创建删除移动拷贝重命名)
2010-11-15 17:22 877using System; using System.Dat ... -
Image和byte[]之间的转换
2010-11-11 17:05 1166image到byte[] 用到memoryStream类 ... -
.net framework--程序打包--打包.net运行库
2010-10-17 21:05 1646VS03默认是不能把.net运行库打包到自己要发布 ... -
WinForm最简单两GridView同步滚动
2010-09-10 10:28 1643今天在园子里看到一个人问,如何让两个DataGridView保 ... -
直接用aspx页面生成的html文件(不用建立自己的html模板)
2010-09-10 09:29 1373public static string Rend ... -
facebook代理软件
2010-09-09 16:32 203facebook代理软件 -
VS2005水晶报表PUSH模式(DataSet)视频教程+源代码工程示例
2010-09-09 08:37 2320本示例包含: 单表模板演示 多表模板演示 子报表演 ...
相关推荐
本软件集合了批量重复文件的扫描及清除,拷贝、移动、删除文件,清除空文件夹,批量文件重命名,批量文本文件合并及批量文本文件字符替换诸多功能,支持通过不同扩展名扫描得到相应的文件,再进行相应的处理,合并...
资源管理器中文件夹与文件的使用及管理: 在考生文件夹下创 建新的文件夹及文件(如TXT 文件及 BMP 文件) 、移动与复制文 件及文件夹、删除文件或文件夹、文件或文件夹重命名;磁盘驱 动器的改名。P65 2. 查找...
当你要编辑或修改某个文档时,必须对文档实施check out 操作(详见3.3.5修改和编辑文件),VSS将该文档从项目中拷贝出来,放入你的工作文件夹。当你修改完毕并check in 文件之后,VSS又将文件重新拷贝到数据库中以...
当你要编辑或修改某个文档时,必须对文档实施check out 操作(详见3.3.5修改和编辑文件),VSS将该文档从项目中拷贝出来,放入你的工作文件夹。当你修改完毕并check in 文件之后,VSS又将文件重新拷贝到数据库中以...
当你要编辑或修改某个文档时,必须对文档实施check out 操作(详见3.3.5修改和编辑文件),VSS将该文档从项目中拷贝出来,放入你的工作文件夹。当你修改完毕并check in 文件之后,VSS又将文件重新拷贝到数据库中以...
move 盘符路径要移动的文件名 存放移动文件的路径移动后文件名 移动文件,用参数/y将取消确认移动目录存在相同文件的提示就直接覆盖 fc one.txt two.txt > 3st.txt 对比二个文件并把不同之处输出到3st.txt文件中...
TransMac 11破解版是一款可以读、写和格式化Macintosh高密度磁盘、CD-ROM以及SCSI光驱(包括SyQuest、Bernoulli、Zip、...当然,它允许用户执行的操作,包括读写数据,而且复制、重命名和删除文件和文件夹就像普通磁盘上。
RAR 是一个强力压缩工具,允许你管理和操作压缩文件。控制台 RAR 只支持 RAR 格式,带有的 ".rar" 扩展名的文件。ZIP 和其他格式不被支持。Windows 用户可以 安装图形界面 RAR 版本 - WinRAR,它可以处理更多的...
Linux提供了大量的命令,利用它可以有效地完成大量的工作,如磁盘操作、文件存取、目录操作、进程管理、文件权限设定等。所以,在Linux系统上工作离不开使用系统提供的命令。要想真正理解Linux系统,就必须从Linux...