pass data to a text file! What this error means?

S

sympatico

pls help me slove this problem. i am a newbie in using asp.net and SQL
server 2000 and my problem for now is to pass data to a textfile and i have
fail to do so.
the way i did it was i used a datagrid to display certain data for the user
to choose, as they check the checkbox beside the data, the data shall be
store into a text file. therefore, i wrote this

oWrite = oFile.CreateText("C:\Inetpub\wwwroot\VolunteerMatch\tempstore.txt")
oWrite.WriteLine(Request.Form("mycheckboxgroup"))
oWrite.Close()

but in the end, it shows the error like this


Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot\VolunteerMatch\tempstore.txt" 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

i do not really know wat this means, could you please help me solve this
problem? and can u please suggest me how to trigger searching capability?
can i use the data in the text file to trigger search with other database
data, so that certain data can be find out as a search result?

Thank you
 
P

Patrick Steele [MVP]

Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot\VolunteerMatch\tempstore.txt" 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

i do not really know wat this means, could you please help me solve this
problem?

Did you follow the instructions shown above? Did you add the user to
the security tab for the folder?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top