Wrox Programmer Forums
|
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
 
Old November 7th, 2003, 01:24 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default 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

 
Old November 7th, 2003, 01:32 AM
Authorized User
 
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

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...)
 
Old November 7th, 2003, 02:37 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

Hi Van,

u set the IE permission on the server or ur PC?

Best Regards
life's Ng


 
Old November 7th, 2003, 07:26 AM
Registered User
 
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to inancgumus Send a message via MSN to inancgumus
Default

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]
 
Old November 7th, 2003, 10:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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.

 
Old November 7th, 2003, 10:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can also have it write to your machine to see if your code is correct. Just change the path to your computer.

 
Old November 7th, 2003, 10:25 AM
Registered User
 
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to inancgumus Send a message via MSN to inancgumus
Default

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]
 
Old November 7th, 2003, 10:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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.

 
Old November 10th, 2003, 01:57 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

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


 
Old November 10th, 2003, 11:29 PM
Authorized User
 
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

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...)





Similar Threads
Thread Thread Starter Forum Replies Last Post
deny downloading image files. jojys Javascript How-To 1 October 19th, 2004 03:17 PM
SQL Access/ASP.NET data access issue saeta57 SQL Server ASP 1 July 4th, 2004 04:29 PM
SQL Access/ASP.NET data access issue saeta57 Classic ASP Databases 1 July 4th, 2004 03:32 PM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.