Click here to Skip to main content
15,388,998 members
Home / Discussions / Web Development
   

Web Development

 
QuestionRe: calling a javascript Pin
JimmyRopes25-May-07 22:52
professionalJimmyRopes25-May-07 22:52 
QuestionWriting text file in Visual studio .net 2003 Pin
Junior Boy22-May-07 19:54
MemberJunior Boy22-May-07 19:54 
AnswerRe: Writing text file in Visual studio .net 2003 Pin
Expert Coming22-May-07 20:00
MemberExpert Coming22-May-07 20:00 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy22-May-07 20:45
MemberJunior Boy22-May-07 20:45 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Expert Coming22-May-07 20:55
MemberExpert Coming22-May-07 20:55 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy22-May-07 21:39
MemberJunior Boy22-May-07 21:39 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Expert Coming22-May-07 21:51
MemberExpert Coming22-May-07 21:51 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy22-May-07 22:10
MemberJunior Boy22-May-07 22:10 
I coppied your code and paste it and then run it and this is the result :

===================================================================================================
Combining FileMode: Create with FileAccess: Read is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Combining FileMode: Create with FileAccess: Read is invalid.

Source Error:


Line 22: // Put user code to initialize the page here
Line 23: //FileStream outStream=File.Create("c:\\mytext.txt");
Line 24: FileStream outStream = new FileStream("c:\\mytext.txt", FileMode.Create, FileAccess.Read);
Line 25: StreamWriter st=new StreamWriter(outStream);
Line 26: st.WriteLine(DateTime.Now.ToString());


Source File: c:\inetpub\wwwroot\convert2chart\test.aspx.cs Line: 24
===================================================================================================

And I tried to change the FileAccess to ReadWrite and it has debugged and the error detail the same the first post message I shown you.


===================================================================================================
Access to the path "c:\mytext.txt" is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path "c:\mytext.txt" is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 22: // Put user code to initialize the page here
Line 23: //FileStream outStream=File.Create("c:\\mytext.txt");
Line 24: FileStream outStream = new FileStream("c:\\mytext.txt", FileMode.Create, FileAccess.ReadWrite);
Line 25: StreamWriter st=new StreamWriter(outStream);
Line 26: st.WriteLine(DateTime.Now.ToString());


Source File: c:\inetpub\wwwroot\convert2chart\test.aspx.cs Line: 24
===================================================================================================


I really don't know what going wrong with this.
Do you have other suggestion for me?
Thank you for your time and still hope you not get mad me yet Smile | :)




junior boy

GeneralRe: Writing text file in Visual studio .net 2003 Pin
DavidNohejl22-May-07 23:43
MemberDavidNohejl22-May-07 23:43 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy22-May-07 23:51
MemberJunior Boy22-May-07 23:51 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
DavidNohejl23-May-07 0:41
MemberDavidNohejl23-May-07 0:41 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Expert Coming23-May-07 9:14
MemberExpert Coming23-May-07 9:14 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy23-May-07 20:54
MemberJunior Boy23-May-07 20:54 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Paddy Boyd24-May-07 2:58
MemberPaddy Boyd24-May-07 2:58 
GeneralRe: Writing text file in Visual studio .net 2003 Pin
Junior Boy24-May-07 20:46
MemberJunior Boy24-May-07 20:46 
Questioniframes and ie Pin
eggsovereasy22-May-07 11:02
Membereggsovereasy22-May-07 11:02 
QuestionNeed Help with Apache installation Pin
Evgeni5722-May-07 10:14
MemberEvgeni5722-May-07 10:14 
QuestionGet time Pin
matjame22-May-07 4:06
Membermatjame22-May-07 4:06 
AnswerHow to put a clock on a webpage (Dreamweaver / Flash not requred!) Pin
Fred_Smith22-May-07 5:01
MemberFred_Smith22-May-07 5:01 
GeneralRe: How to put a clock on a webpage (Dreamweaver / Flash not requred!) Pin
matjame23-May-07 0:50
Membermatjame23-May-07 0:50 
GeneralRe: How to put a clock on a webpage (Dreamweaver / Flash not requred!) Pin
Fred_Smith23-May-07 1:12
MemberFred_Smith23-May-07 1:12 
AnswerRe: Get time Pin
Expert Coming22-May-07 10:58
MemberExpert Coming22-May-07 10:58 
AnswerRe: Get time Pin
JimmyRopes22-May-07 11:20
professionalJimmyRopes22-May-07 11:20 
QuestionIt's a Wonder... Pin
#realJSOP22-May-07 3:04
mva#realJSOP22-May-07 3:04 
AnswerRe: It's a Wonder... Pin
Fred_Smith22-May-07 3:35
MemberFred_Smith22-May-07 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.