 |
| ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 7th, 2003, 01:24 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
access deny......
hi... im trying to write a file to a server, but it keep showing me this error:
Access to the path "Z:\ATVSBK.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 "Z:\ATVSBK.txt" is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
i follow the instruction n change the properties, but i still get the same error...
can any1 pls tell me y...?
Best Regards
life's Ng
|
|

November 7th, 2003, 01:32 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Not sure, but consider:
Sometimes I have had to give ASPNET Modify permission to the folder that contains the file I'm trying to write. Same instructions, just check the Modify checkbox instead of Write.
-Van
(Old dog learning new tricks...)
|
|

November 7th, 2003, 02:37 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Van,
u set the IE permission on the server or ur PC?
Best Regards
life's Ng
|
|

November 7th, 2003, 07:26 AM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can you please supply your source code and the access permissions which are given to z:\ drive.
Inanc Gumus
Software Architect
can be reached at [email protected]
|
|

November 7th, 2003, 10:21 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
The server, Z drive, needs to have permission from the ASPNET user. Give the permission to the folder that the .txt file is being written to.
|
|

November 7th, 2003, 10:23 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You can also have it write to your machine to see if your code is correct. Just change the path to your computer.
|
|

November 7th, 2003, 10:25 AM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by stu9820
The server, Z drive, needs to have permission from the ASPNET user. Give the permission to the folder that the .txt file is being written to.
|
Sure it is. But if you look up you will see vknowles's post:
'Sometimes I have had to give ASPNET Modify permission to the folder that contains the file I'm trying to write. Same instructions, just check the Modify checkbox instead of Write.'
So, if this could not solve the problem; questioner must send more detail about his problem.
Inanc Gumus
Software Architect
can be reached at [email protected]
|
|

November 7th, 2003, 10:37 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Yes I agree. I think there should be rules that you have to supply source code when you ask a question that deals with code.
|
|

November 10th, 2003, 01:57 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
orh, sorry Mr. Peter and Mr. Inancgumus , thanks u all, the code as below:
Dim objStreamWriter As StreamWriter
Instructions.Text=Instructions.Text.Replace("'","' '")
'GENERATING A RANDOM FILENAME
Dim FileName as string
FileName = chr(Int((90 - 65 + 1) * Rnd + 65))+chr(Int((90 - 65 + 1) * Rnd + 65))+chr(Int((90 - 65 + 1) * Rnd + 65))+chr(Int((90 - 65 + 1) * Rnd + 65))+chr(Int((90 - 65 + 1) * Rnd + 65))+chr(Int((90 - 65 + 1) * Rnd + 65))
'PASS THE FILE PATH AND THE FILE NAME TO THE STREAMWRITER CONSTRUCTOR
' objStreamWriter = New StreamWriter("D:\"+FileName+".txt")
objStreamWriter = New StreamWriter("Z:\"+FileName+".txt")
'WRITE A LINE OF TEXT
objStreamWriter.WriteLine(Mobile+vbtab+Instruction s.Text)
'CLOSE THE FILE
objStreamWriter.Close()
i can write the file in my own computer, i oso feel like need the server to give permission to aspnet user, but the person who incharge for the server is not available... hai.... im sick of the permission...
Best Regards
life's Ng
|
|

November 10th, 2003, 11:29 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Security can be a real headache.
There is no way to get your code to work without setting permissions on the Z drive, and the owner of the Z drive controls those permissions.
I really think that will solve your problem, and nothing else will!
:(
-Van
(Old dog learning new tricks...)
|
|
 |