asp.net文件和文件夹压缩
法一:调用winrar
using Microsoft.Win32;
using System.Diagnostics;
protected void Button1_Click(object sender, EventArgs e)
{
RAR(@"E:\95413594531\GIS", "tmptest", @"E:\95413594531\");
}
/// <summary>
/// 压缩文件
/// </summary>
/// <param name="DFilePath">需要压缩的文件夹或者单个文件</param>
/// <param name="DRARName">生成压缩文件的文件名</param>
/// <param name="DRARPath">生成压缩文件保存路径</param>
/// <returns></returns>
protected bool RAR(string DFilePath, string DRARName,string DRARPath)
{
String the_rar;
RegistryKey the_Reg;
Object the_Obj;
String the_Info;
ProcessStartInfo the_StartInfo;
Process the_Process;
try
{
the_Reg = Registry.ClassesRoot.OpenSubKey(@"Applications\WinRAR.exe\Shell\Open\Command");
the_Obj = the_Reg.GetValue("");
the_rar = the_Obj.ToString();
the_Reg.Close();
the_rar = the_rar.Substring(1, the_rar.Length - 7);
the_Info = " a " + " " + DRARName + " " + DFilePath +" -ep1"; //命令 +
相关文档:
ASP.NET常见安全问题
一、SQL语句漏洞
许多程序员在用sql语句进行用户密码验证时是通过一个类似这样的语句来实现的:
Sql="Select * from 用户表 where 姓名 = '" + name + "' and 密码 = '" + password + "'"
通过分析可以发现,上述语句存在着致命的漏洞。当我们在用户名称中输入下面的字符串时:tes ......
C#:成员变量首字母大写而且前面加下划线
1.连接对象静态与非静态问题
2.数据访问类为什么不能派生与DBConnection
3.Catch的作用,以及为什么可以在这里省掉
4.在数据访问方法中,为什么不直接实例化 List<NationData> list;
  ......
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<!--
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0 ......
一、目前在ASP.NET中页面传值共有这么几种方式:
第一种方法:
通过URL链接地址传递
send.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?usern ......
一说到新闻系统的话,一定会谈到静态页面生成的,因为静态页面不但是读取速度快,而且又安全;
静态页面的生成不管是小到现在的企业网站大至网易,QQ等门户都用到了;
那么我们如何来生成静态页呢?
以什么方式生成静态页面呢……
在生成静态页面的时候有那些是要注意的呢:
静态页面命名
统一存放目录 ......