c# - cannot upload file to server getting error "device not ready" -


when i'm trying upload .htm file server selecting file dropdown list getting exception. details of exception given below

 system.io.ioexception unhandled user code   message=the device not ready.    source=mscorlib   stacktrace:        @ system.io.__error.winioerror(int32 errorcode, string maybefullpath)        @ system.io.filestream.init(string path, filemode mode, fileaccess access, int32 rights, boolean userights, fileshare share, int32 buffersize, fileoptions options, security_attributes secattrs, string msgpath, boolean bfromproxy, boolean uselongpath)        @ system.io.filestream..ctor(string path, filemode mode, fileaccess access, fileshare share, int32 buffersize, fileoptions options)        @ system.io.streamreader..ctor(string path, encoding encoding, boolean detectencodingfrombyteordermarks, int32 buffersize)        @ system.io.streamreader..ctor(string path, encoding encoding)        @ system.io.file.internalreadalltext(string path, encoding encoding)        @ system.io.file.readalltext(string path)        @ e_request.report.dropdownlist1_selectedindexchanged(object sender, eventargs e) in c:\users\administrator\desktop\smartultrasoundpatientschedulingsystem\trunk\code\e_request\e_request\report_writing.aspx.cs:line 107        @ system.web.ui.webcontrols.listcontrol.onselectedindexchanged(eventargs e)    @ system.web.ui.webcontrols.dropdownlist.raisepostdatachangedevent()    @ system.web.ui.webcontrols.dropdownlist.system.web.ui.ipostbackdatahandler.raisepostdatachangedevent()    @ system.web.ui.page.raisechangedevents()    @ system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint)   string doc_content = file.readalltext("e:\\rajesh\\us_schedular\\template_htm\\" + dropdownlist1.selecteditem + ".htm");  doc_content = server.htmlencode(doc_content);  foreach (string parameter in details)  {      doc_content = replacetext(doc_content, variablenames[count], parameter);        count++;  }  ckeditor1.text = doc_content;  

i think don't use method access directory.

 server.mappath(...) 

check link1...

check link2...


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -