If (fileupload1.postedfile. inputstream. length <1) {return;} string filename = fileupload1.filename; // file name string filepath = fileupload1.postedfile. filename; // file path if (filename. tolower (). indexof (". CSV ") =-1) {return;} int filelen = fileupload1.postedfile. contentlength; // file size byte [] input = new byte [filelen]; system. io. stream fileuploadstream = fileupload1.postedfile. inputstream; fileuploadstre Am. read (input, 0, filelen); fileuploadstream. position = 0; system. io. streamreader sr = new system. io. streamreader (fileuploadstream, system. text. encoding. default); string strline; while (strline = sr. readline ())! = NULL) {strline = strline. replace ("\" "," "); string [] strblock = strline. split (','); // do something ...} sr. close (); fileuploadstream. close (); Sr = NULL; fileuploadstream = NULL;