閱讀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瀏覽器中保存密碼那些事兒