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

文件上传代码(asp.net)

Boolean fileOK = false;
        String path = "D:\\";
        //string path = "1.gif";
      
            String fileExtension =
                System.IO.Path.GetExtension(Myfile.Value).ToLower();
            string str1=System.IO.Path.GetFileName(Myfile.Value);
            String[] allowedExtensions =
                { ".gif", ".png", ".jpeg", ".jpg" };
            string temp = System.IO.Path.GetTempPath();
            string temp1 = Server.MapPath("./");
            for (int i = 0; i < allowedExtensions.Length; i++)
            {
                if (fileExtension == allowedExtensions[i])
                {
                    fileOK = true;
                }
            }
       
        if (fileOK)
        {
            try
          &nbs


相关文档:

ASP.NET关闭当前窗口同时打开一个新窗口

首先,在pageload里写入以下代码:Response.Write("<script>window.opener=null;window.close();</script>");
其次,在head里写下如下JS代码: <script language="JavaScript">
<!--
function openwin() { window.open ("Default.aspx", "newwindow", "height=600, width=600, toolbar=no, menubar=n ......

asp.net 运行原理

主要类:
  System.Web.HttpRuntime
  System.Web.HttpApplicationFactory
  System.Web.HttpApplication
  System.Web.Compilation.BuildManager
  System.Web.Compilation.ApplicationBuildProvider
  System.Web.Compilation.BuildProvidersCompiler
  System.Web.UI.PageHandlerFactory
请求处理 ......

ASP.NET文件上传,为每个用户建立一个上传目录

文件上传界面既可以用Html的input file控件,又可以用FileUpload控件,只要将Html的input file控件加上runat="server",就会发现两者的功能完全是一模一样,上传的代码是共用的,不需要做任何改变。我想微软在将Html控件将成标准控件时应该只是多加了runat="server"吧。放入上述两者的任一控件后,添加一个标准的Button按钮 ......

在ASP.NET中下载文件

//TransmitFile实现下载
    protected void Button1_Click(object sender, EventArgs
e)
    {
        /*
       
微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号