how to read the content of the file using Fileupload

前端 未结 2 1180
深忆病人
深忆病人 2021-01-12 08:18

Is it possible to read the content of a file using Fileupload.

For example I want to save the XML file in Database , a user search the file using Fileupload and then

2条回答
  •  抹茶落季
    2021-01-12 09:02

    string inputContent;
    using (StreamReader inputStreamReader = new StreamReader(InputFileUpload.PostedFile.InputStream))
    {
        inputContent = inputStreamReader.ReadToEnd();
    }
    

提交回复
热议问题