473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Access problems trying to access my log files

I am trying to access my log files and am running into a permissions
problem.

I am doing the following:

************************************************** ****************
private void PopulateSiteBox()
{
drpSiteBox.Items.Clear();
string FILE_PATH = @"\\" +txtMachine.Text +
@"\C$\windows\System32\LogFiles\";

Trace.Warn("FILE_PATH = " + FILE_PATH);

DirectoryInfo di = new DirectoryInfo(FILE_PATH);
foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
{
if(fsi.Name.StartsWith("W3"))
drpSiteBox.Items.Add(fsi.Name);
}
}
************************************************** *******************

The error I am getting is on the GetFileSystemInfos() call. This is trying
to access:

FILE_PATH = \\sam\C$\windows\System32\LogFiles\

To get the W3... folder to get the name of the folder the ex040920.log is
in.

I tried to audit the folder LogFiles setting the success and failure to all
and to everyone. I wanted to find out what user is trying to access the
folder. I am not sure what user the asp.net is using.

The error I get is:

************************************************** ***************************
Access to the path "\\tfs\C$\windows\System32\LogFiles\" 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
"\\tfs\C$\windows\System32\LogFiles\" 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.

************************************************** ****************************

As I said I did try to set the permissions to everyone to solve the problem
(temporarily). This is only on my WXP Pro machine so I am not concerned
with anyone getting access to my machine.

What do I need to set to make this work?

Thanks,

Tom.

Nov 19 '05 #1
5 2110
you cannot use a unc path, unless you give the asp.net account network
permisions. use

string FILE_PATH = @"C:\windows\System32\LogFiles\";

-- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oc**************@TK2MSFTNGP09.phx.gbl...
| I am trying to access my log files and am running into a permissions
| problem.
|
| I am doing the following:
|
| ************************************************** ****************
| private void PopulateSiteBox()
| {
| drpSiteBox.Items.Clear();
| string FILE_PATH = @"\\" +txtMachine.Text +
| @"\C$\windows\System32\LogFiles\";
|
| Trace.Warn("FILE_PATH = " + FILE_PATH);
|
| DirectoryInfo di = new DirectoryInfo(FILE_PATH);
| foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
| {
| if(fsi.Name.StartsWith("W3"))
| drpSiteBox.Items.Add(fsi.Name);
| }
| }
| ************************************************** *******************
|
| The error I am getting is on the GetFileSystemInfos() call. This is
trying
| to access:
|
| FILE_PATH = \\sam\C$\windows\System32\LogFiles\
|
| To get the W3... folder to get the name of the folder the ex040920.log is
| in.
|
| I tried to audit the folder LogFiles setting the success and failure to
all
| and to everyone. I wanted to find out what user is trying to access the
| folder. I am not sure what user the asp.net is using.
|
| The error I get is:
|
|
************************************************** **************************
*
| Access to the path "\\tfs\C$\windows\System32\LogFiles\" 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
| "\\tfs\C$\windows\System32\LogFiles\" 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.
|
|
************************************************** **************************
**
|
| As I said I did try to set the permissions to everyone to solve the
problem
| (temporarily). This is only on my WXP Pro machine so I am not concerned
| with anyone getting access to my machine.
|
| What do I need to set to make this work?
|
| Thanks,
|
| Tom.
|
|
|
|
|
Nov 19 '05 #2
"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
you cannot use a unc path, unless you give the asp.net account network
permisions. use

string FILE_PATH = @"C:\windows\System32\LogFiles\";
I gave LogFiles Everyone access to everything ( I assume that that would
include the asp.net Account). Do I also have to do it for the "windows" and
"System32" folders?

How do I tell what the asp.net account is? That was what I was trying to do
when I set up auditing on the LogFiles folder, but there was nothing in the
event viewer for it.

Could that have been because it was actually getting the error on the
"windows" or "system32" folder?

Thanks,

Tom.
-- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oc**************@TK2MSFTNGP09.phx.gbl...
| I am trying to access my log files and am running into a permissions
| problem.
|
| I am doing the following:
|
| ************************************************** ****************
| private void PopulateSiteBox()
| {
| drpSiteBox.Items.Clear();
| string FILE_PATH = @"\\" +txtMachine.Text +
| @"\C$\windows\System32\LogFiles\";
|
| Trace.Warn("FILE_PATH = " + FILE_PATH);
|
| DirectoryInfo di = new DirectoryInfo(FILE_PATH);
| foreach(FileSystemInfo fsi in di.GetFileSystemInfos())
| {
| if(fsi.Name.StartsWith("W3"))
| drpSiteBox.Items.Add(fsi.Name);
| }
| }
| ************************************************** *******************
|
| The error I am getting is on the GetFileSystemInfos() call. This is
trying
| to access:
|
| FILE_PATH = \\sam\C$\windows\System32\LogFiles\
|
| To get the W3... folder to get the name of the folder the ex040920.log
is
| in.
|
| I tried to audit the folder LogFiles setting the success and failure to
all
| and to everyone. I wanted to find out what user is trying to access the
| folder. I am not sure what user the asp.net is using.
|
| The error I get is:
|
|
************************************************** **************************
*
| Access to the path "\\tfs\C$\windows\System32\LogFiles\" 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
| "\\tfs\C$\windows\System32\LogFiles\" 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.
|
|
************************************************** **************************
**
|
| As I said I did try to set the permissions to everyone to solve the
problem
| (temporarily). This is only on my WXP Pro machine so I am not concerned
| with anyone getting access to my machine.
|
| What do I need to set to make this work?
|
| Thanks,
|
| Tom.
|
|
|
|
|

Nov 19 '05 #3
Hi Tom,
Did you get it working?
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4
"Patrick Olurotimi Ige" <pa*********@crazyjohns.com.au> wrote in message
news:OM****************@TK2MSFTNGP14.phx.gbl...
Hi Tom,
Did you get it working?
Not yet.

I am going to try to put access permissions on a file in my asp.net
application folder and try to open it it and see who the user is.

This whole permission thing has always been my downfall. All the
local/global permissions has always driven me crazy when I am trying to set
up service or schedular task or stored procedure. It invariably happens
that there is some function I am trying to execute that needs some special
access permission that I need to figure out.

Tom
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #5
Hi Tom,
As Bruce explained you cannot use a unc path, unless you give the
asp.net account network permisions.
I have developed a similar application and i had to give asp.net
account network permisions(but uploading!)
What exact error are u getting now after granting ASP.NET.
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: tdmailbox | last post by:
I developed an access database in access 2003(keeping my database in the access 2000 format). It has been fully tested to be access 2000 compatible and works great. I am trying to package the...
4
by: RichB | last post by:
Hello, The .NET application I have just installed at a client web site is throwing a strange error. At first the applications works without any problems, but after 10 mins or so Access denied...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
2
by: Joey | last post by:
I have a web app that uses forms authentication. The app also has a downloads section, and I need to be able to use <location> tags to control access to the downloadable files there (preferably by...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
5
by: MikeJingJing | last post by:
Hi everyone ok I have 2 serious problems.. Firstly a little background is that i'm using ASP.NET 2.0 (obviously with the 2.0 Framework) with an Access Database. In my Web App i have an upload...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.