先看效果
WebFileManager
代码如下
<!--
Author: 张浩华
DateTime: 2012-07-06 03:25
-----------------------------------
管理Web站点下文件的页面程序。
提供上传、重命名、删除、创建文件夹、下载等功能。
-->
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
string Msg = string.Empty;
static string _CURRENT_PATH = "";
protected void Page_Load(object sender, EventArgs e)
{
InitFiles();
switch (Request["action"])
{
case "Root":
Root();
break;
case "Back":
Back();
break;
case "Open":
Open(Request["FileName"]);
break;
case "Delete":
Delete(Request["FileName"]);
break;
}
}
protected void btnUpload_Click(object sender, EventArgs e)
{
if (fuFile.HasFile)
{
string currentPath = GetCurrentPath();
string fileName = fuFile.FileName;
if (rbCover.Checked)
{
}
else if (rbRename.Checked)
{
while (System.IO.File.Exists(currentPath + fileName))
{
fileName = "new_" + fileName;
}
}
fuFile.SaveAs(currentPath + fileName);
}
InitFiles();
}
protected void btnSave_Click(object sender, EventArgs e)
{
string oleFileName = hfOldName.Value;
string newFileName = txtNewName.Text;
if (string.IsNullOrEmpty(newFileName))
{
Msg = "The file name can't for empty !";
return;
}
string currentPath = GetCurrentPath();
string oldPath = currentPath + oleFileName;
string newPath = currentPath + newFileName;
if (IsFile(oldPath))
{
if (System.IO.File.Exists(newPath))
{
Msg = "The file name repeated, please reset.";
return;
}
System.IO.File.Move(oldPath, newPath);
}
else
{
if (string.IsNullOrEmpty(oleFileName))
{
System.IO.Directory.CreateDirectory(newPath);
}
else
{
System.IO.Directory.Move(oldPath, newPath);
}
}
InitFiles();
}
private void Back()
{
string path = GetCurrentPath();
string parent = new System.IO.DirectoryInfo(path).Parent.FullName + "\";
if (parent.IndexOf(Server.MapPath("~/")) >= 0)
{
_CURRENT_PATH = parent;
}
Response.Redirect(Request.Url.AbsolutePath);
}
private void Delete(s
石家庄网站建设的优点:我们是专属定制,制作符合您公司业务、风格的网站,这就做到给您制作的网站是网络上独一无二的网站,这样更有利于搜索引擎的收录。如果您喜欢网络上某个风格的网站或者网站模板,我们是只仿制而不直接套用,我们会对其中的结构和样式做增减优化,做…
竞价排名营销是一种通过 竞价购买搜索引擎中关键词或关键短语的广告方式。竞价排名营销分为两种类型。 第一种,直接为真正的搜索引擎结果的排名付费,也就是说付的钱越多,网页所获得的排名名也就越高。 第二种则更类似于普通的广告。这种竞价排名营销方式通过…
网站优化对网站来说是非常重要的,直接决定和影响着网站所起到的作用,以及在各个地方当中的排名。在进行seo优化的过程中,我们必须要坚持一定的原则,真正的把这些事情做得更好,才可以确保最终的结果,这对于我们来说是非常重要的事。 SEO优化主要分为8小步: …