阅读757 返回首页    go 阿里云 go 技术社区[云栖]


asp.net提交文件处理

  
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";
        string strPath = context.Server.MapPath("hello2.htm");   //获取文件的路径
        context.Response.Write(strPath);                         //输出路径
        string strContents = System.IO.File.ReadAllText(strPath);//获取文件的内容
        context.Response.Write(strContents);                     //输出一个网页
        string strUserName = context.Request["txtUserName"];     //获取用户名
        if (string.IsNullOrEmpty(strUserName))                   //判断是否存在用户名
        {
            context.Response.Write("直接进入 --welcome, " + strUserName);
        }
        else
        {
            context.Response.Write("提交进入 --welcome, " + strUserName);
        }
    }

最后更新:2017-04-02 00:06:56

  上一篇:go linux 的date命令及系统时间设置
  下一篇:go 浅析Chrome浏览器中保存密码那些事儿