Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 March 11th, 2009, 09:48 AM
Registered User
 
Join Date: Mar 2009
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
Default Logon failure: unknown user name or bad password, on Response.WriteFile

Hi all,
Within my website I obtain a lot of data from SQL, this works fine and the gridviews display without any problem.
However one particular grid holds 'newsletter/correspondence' in multiple formats. Whenever I try to open one of these files I recieve the below error. I'm at a bit of a loss as it's the same user set up with the same priveledges.
Does anyone know what I've done incoorect?
Logon failure: unknown user name or bad password.

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.IO.IOException: Logon failure: unknown user name or bad password.


Source Error:


Code:
             Response.ClearHeaders()
             Response.ContentType = "application/pdf"
             Response.WriteFile("\\" + e.CommandArgument.ToString())
             Response.AddHeader("Content-Disposition", String.Format("attachment; filename={0}", e.CommandArgument.ToString()))
             Response.Flush()
Source File: C:\Inetpub\wwwroot\membArea\memberPages\correspond ence.aspx.vb Line: 12

Last edited by excelf1; March 11th, 2009 at 12:22 PM..
 
Old March 11th, 2009, 03:37 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This line right here: Response.WriteFile("\\" + e.CommandArgument.ToString()) this is just a guess since there isn't much to go on but, for whatever reason, the File or Directory you are trying to acess and subsequentially write to the HTTP Stream is not accessible to ASP.NET user. If this proves to be true you will either A) need to grant perms to the ASP.NET user or B)use impersonaition to access the file.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
excelf1 (March 13th, 2009)
 
Old March 12th, 2009, 12:21 AM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 2
Thanked 1 Time in 1 Post
Default

Hello,
I would like to add one more thing to the above reply.
Please check under which account your application runs (Basically application pool if your application is under any app pool -IIS6). It can be IUSR or can be some sort of service account also. Please give the read and write access to the folder from which you are trying to read the file.
The Following User Says Thank You to abinashpatra For This Useful Post:
excelf1 (March 13th, 2009)
 
Old March 18th, 2009, 09:11 AM
Registered User
 
Join Date: Mar 2009
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
Default Thanks

Thanks, I solved the problem.
 
Old March 18th, 2009, 09:30 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

For the sake of anyone else that might stumble across this thread what did the problem end up being and how did you resolve it?

-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old March 25th, 2009, 10:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Working fine. Please don't clutter the forums with test messages...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset SQL Logon Password thru Access Front End feets Access VBA 5 March 11th, 2009 09:22 AM
prevent user logon and password from saving Hughesie78 ASP.NET 2.0 Basics 1 December 6th, 2007 12:20 PM
One user getting logon screen digby_dog Access 4 August 6th, 2007 12:44 PM
Logon failure: user account restriction. Possible zaghmout HTML Code Clinic 2 January 6th, 2007 10:34 AM
"Logon Failure" when trying to connect to SQL Ser. wpossie BOOK: Professional Crystal Reports for VS.NET 1 August 4th, 2004 07:33 AM





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