易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET模拟指定帐号权限, 删除非本机图片文件

 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentException: 不支持 URI 格式。
源错误:
行 30: protected void BTNCLick(object sender, EventArgs e)
行 31: {
行 32: System.IO.File.Delete(path + "200911313360.jpg");
行 33: ScriptManager.RegisterStartupScript(Page, typeof(Page), "ok", "alert('删除成功');", true);
行 34: }
不支持 URI 格式。
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
    protected System.Web.UI.WebControls.Label lbExist;
        protected System.Web.UI.WebControls.Label Label2;
        public const int LOGON32_LOGON_INTERACTIVE = 2;
        public const int LOGON32_PROVIDER_DEFAULT = 0;
        WindowsImpersonationContext impersonationContext; 
        [DllImport("advapi32.dll", CharSet=CharSet.Auto)]
        public static extern int LogonUser(String lpszUserName,String lpszDomain,
        String lpszPassword,int dwLogonType,int dwLogonProvider,
        ref IntPtr phToken);
        [DllImport("advapi32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto, 
        SetLastError=true)]
        public extern static int DuplicateToken(IntPtr hToken,int impersonationLe


相关文档:

ASP.NET 常用的正则表达式

 用正则表达式限制只能输入中文:
  1.用正则表达式限制只能输入全角字符:
  2.用正则表达式限制只能输入数字:
  3.用正则表达式限制只能输入数字和英文:
  4.计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)
  String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa"). ......

ASP.NET中Cookie的使用

设计意图:将login页面中的登录信息保存在login的Cookie中,转到Home页面时,利用得到的Cookie值就能自动登录 
login页面前台关于Cookie的代码:
<td>
      &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID= ......

ASP.Net页面静态化

 步骤:
1. 新建一个WEB解决方案名称为HtmlStatic。
2. 在项目下建一个HtmlTemp.htm其代码如下:
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head&g ......

Asp.net 常见错误

错误 CS0001 编译器内部错误
错误 CS0003 内存溢出
错误 CS0004 提升为错误的警告
错误 CS0005 编译器选项后应跟正确的参数
错误 CS0006 找不到动态链接的元数据文件
错误 CS0007 .Net 环境初始化错误
错误 CS0008 从文件中读取元数据错 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号