473,236 Members | 1,668 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,236 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 2108
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.