易截截图软件、单文件、免安装、纯绿色、仅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、给删除按钮添加是否确认提示:
   前台方法:OnClientClick="return window.confirm('你确定要删除吗?')"
   后台方法:btnDelete.Attributes.Add("onclick", "return confirm('您确定要删除吗?');");
2、DataSet中取值:
   lblTitle.Text = ds.Tables[0].Rows[0]["Title"]. ......

Asp.net 常见错误

错误 CS0001 编译器内部错误
错误 CS0003 内存溢出
错误 CS0004 提升为错误的警告
错误 CS0005 编译器选项后应跟正确的参数
错误 CS0006 找不到动态链接的元数据文件
错误 CS0007 .Net 环境初始化错误
错误 CS0008 从文件中读取元数据错 ......

ASP.NET页面回发与事件回传

         页面事件顺序是固定的,但页面上的控件事件则依赖具体页面和用户的操作。如果控件的AutoPostBack属性设置为true(默认值为false),那么将立刻引起页面回发,即页面中各个控件的值回传到Web服务器上,引发相应事件,由事件的处理程序处理。处理完成后如果没有跳转指令,该页面 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号