Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 September 9th, 2006, 03:47 AM
Authorized User
 
Join Date: Jul 2006
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
Default Polls.Config

I wrote a code to read from a file(Polls.config).Locally no problem occured but after uploading the project to the web a dialog appeared asking me for the UserName and Password and when I click Cancel Button the following error occur:
Access to the path "C:\Sites\Single25\nabeel1eagle\webroot\Administra torSite\Polls.config" is denied.
Please..could any one help?

 
Old September 10th, 2006, 08:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is an NTFS security issue. The user (normally ASPNET if using WinXP,or Network Service is using Win 2003) who runs your website doesn't have Windows permission to read the file.

 
Old September 11th, 2006, 12:48 AM
Authorized User
 
Join Date: Jul 2006
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Is this because it is a (.config) file.I made this file in the same way the book did.

I have uploaded my project to a Web Hosting service server so should I ask them to make the file readable for ASP.NET users?
 
Old September 11th, 2006, 12:04 PM
Authorized User
 
Join Date: Jul 2006
Posts: 40
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I found the solution in one of the previous topics it was:

FileStream fs=new FileStream(filename,FileMode.Open,FileAccess.Read) ;

It was your reply too.Thank you very much for helping the whole forum members.:)

 
Old September 11th, 2006, 09:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That works for reading, but you still need an NTFS adjustment if you want to write to a file, like a log file, for example.

How do you log errors? Most hosting companies don't let you use the Windows event log on a hosted server. That's why I use a log file.

Eric






Similar Threads
Thread Thread Starter Forum Replies Last Post
In the Chapter 6 Opinion Polls mpuisto BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 March 19th, 2007 07:40 PM
Error After Deleting Polls CrassMaestro BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 7th, 2007 12:18 AM
Polls.Config is denied. eugz BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 18th, 2006 08:07 AM
Polls tables relationships nabeelalkaff BOOK: ASP.NET Website Programming Problem-Design-Solution 2 August 10th, 2006 12:18 AM
Error: Polls.Config already exists. Goss444 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 April 7th, 2004 09:44 PM





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