When I'm trying to upload an .htm
file to the server by selecting a file from dropdown list I am getting this exception. The details of the exception is given below
System.IO.IOException was unhandled by user code
Message=The device is not ready.
Source=mscorlib
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding)
at System.IO.File.InternalReadAllText(String path, Encoding encoding)
at System.IO.File.ReadAllText(String path)
at 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
at System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e)
at System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent()
at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
at System.Web.UI.Page.RaiseChangedEvents()
at 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;