473,395 Members | 2,795 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,395 software developers and data experts.

FileSystemObject Errors

I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I have
given Full Trust to the assembly in Code Groups and Assembly Trust. I have
added IUSR and IWAM as users. I have checked and double checked every
permission available. I continue to get a Security Exception error off of
this code:
Dim epth As String = Server.MapPath("/error/errlog.log")
Dim fso As New Scripting.FileSystemObject

fso = Server.CreateObject("Scripting.FileSystemObject")
f = fso.OpenTextFile(epth, IOMode.ForAppending, True)
f.WriteLine("[" & DateString & "][" & TimeString & "] Module
'hs.aspx::Page_Load::General', " & "Error " & Err.Number & ": " &
Err.Description)
f.Close()
Server.Transfer("/hsp/error/100.htm")

The error I get is this:

System.Security.SecurityException: Exception from HRESULT: 0x800A0046
(CTL_E_PERMISSIONDENIED).
Nov 19 '05 #1
4 1986
System.Newsgroups.InvalidNewsgroupException: Invalid newsgroup. Please use
microsoft.public.inetserver.asp.general for ASP questions. Exception from
microsoft.public.dotnet.framework.aspnet newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Tony" <To**@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I have
given Full Trust to the assembly in Code Groups and Assembly Trust. I have
added IUSR and IWAM as users. I have checked and double checked every
permission available. I continue to get a Security Exception error off of
this code:
Dim epth As String = Server.MapPath("/error/errlog.log")
Dim fso As New Scripting.FileSystemObject

fso = Server.CreateObject("Scripting.FileSystemObject")
f = fso.OpenTextFile(epth, IOMode.ForAppending, True)
f.WriteLine("[" & DateString & "][" & TimeString & "] Module
'hs.aspx::Page_Load::General', " & "Error " & Err.Number & ": " &
Err.Description)
f.Close()
Server.Transfer("/hsp/error/100.htm")

The error I get is this:

System.Security.SecurityException: Exception from HRESULT: 0x800A0046
(CTL_E_PERMISSIONDENIED).

Nov 19 '05 #2
hahaha Kevin:)
Patrick

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
System.Newsgroups.InvalidNewsgroupException: Invalid newsgroup. Please use
microsoft.public.inetserver.asp.general for ASP questions. Exception from
microsoft.public.dotnet.framework.aspnet newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

"Tony" <To**@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I have given Full Trust to the assembly in Code Groups and Assembly Trust. I have added IUSR and IWAM as users. I have checked and double checked every
permission available. I continue to get a Security Exception error off of this code:
Dim epth As String = Server.MapPath("/error/errlog.log")
Dim fso As New Scripting.FileSystemObject

fso = Server.CreateObject("Scripting.FileSystemObject")
f = fso.OpenTextFile(epth, IOMode.ForAppending, True)
f.WriteLine("[" & DateString & "][" & TimeString & "] Module
'hs.aspx::Page_Load::General', " & "Error " & Err.Number & ": " &
Err.Description)
f.Close()
Server.Transfer("/hsp/error/100.htm")

The error I get is this:

System.Security.SecurityException: Exception from HRESULT: 0x800A0046
(CTL_E_PERMISSIONDENIED).


Nov 19 '05 #3
That's cute. However, I was writing this in ASP.NET so it is, in fact, the
correct newsgroup which makes you a false unhandled exception. Don't worry
though smart guy. I figured it out. Next time, if you don't have anything
useful to say, sit on your hands to keep them off of the keyboard.

"Kevin Spencer" wrote:
System.Newsgroups.InvalidNewsgroupException: Invalid newsgroup. Please use
microsoft.public.inetserver.asp.general for ASP questions. Exception from
microsoft.public.dotnet.framework.aspnet newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Tony" <To**@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I have
given Full Trust to the assembly in Code Groups and Assembly Trust. I have
added IUSR and IWAM as users. I have checked and double checked every
permission available. I continue to get a Security Exception error off of
this code:
Dim epth As String = Server.MapPath("/error/errlog.log")
Dim fso As New Scripting.FileSystemObject

fso = Server.CreateObject("Scripting.FileSystemObject")
f = fso.OpenTextFile(epth, IOMode.ForAppending, True)
f.WriteLine("[" & DateString & "][" & TimeString & "] Module
'hs.aspx::Page_Load::General', " & "Error " & Err.Number & ": " &
Err.Description)
f.Close()
Server.Transfer("/hsp/error/100.htm")

The error I get is this:

System.Security.SecurityException: Exception from HRESULT: 0x800A0046
(CTL_E_PERMISSIONDENIED).


Nov 19 '05 #4
Well, I assumed it was ASP, since you were using the
Scripting.FileSystemObject instead of the .Net System.IO classes. In
addition, the code was indistinguishable from VBScript. I lloked it over.

Here's something useful: Avoid using COM, especially when there are much
better .Net classes in the CLR that can do even more than the COM classes
you are attempting to use. And here's a useful link:

http://msdn.microsoft.com/library/de...rfsystemio.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Tony" <To**@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
That's cute. However, I was writing this in ASP.NET so it is, in fact, the
correct newsgroup which makes you a false unhandled exception. Don't worry
though smart guy. I figured it out. Next time, if you don't have anything
useful to say, sit on your hands to keep them off of the keyboard.

"Kevin Spencer" wrote:
System.Newsgroups.InvalidNewsgroupException: Invalid newsgroup. Please
use
microsoft.public.inetserver.asp.general for ASP questions. Exception from
microsoft.public.dotnet.framework.aspnet newsgroup.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Tony" <To**@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
>I am trying (unsuccessfully) to open a file using fso.OpenTextFile. I
>have
> given Full Trust to the assembly in Code Groups and Assembly Trust. I
> have
> added IUSR and IWAM as users. I have checked and double checked every
> permission available. I continue to get a Security Exception error off
> of
> this code:
>
>
> Dim epth As String = Server.MapPath("/error/errlog.log")
> Dim fso As New Scripting.FileSystemObject
>
> fso = Server.CreateObject("Scripting.FileSystemObject")
> f = fso.OpenTextFile(epth, IOMode.ForAppending, True)
> f.WriteLine("[" & DateString & "][" & TimeString & "] Module
> 'hs.aspx::Page_Load::General', " & "Error " & Err.Number & ": " &
> Err.Description)
> f.Close()
> Server.Transfer("/hsp/error/100.htm")
>
> The error I get is this:
>
> System.Security.SecurityException: Exception from HRESULT: 0x800A0046
> (CTL_E_PERMISSIONDENIED).


Nov 19 '05 #5

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

Similar topics

5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
9
by: spradl | last post by:
Hi, I am trying to create a dynamic CSV file via FileSystemObject.CreateTextFile. I have no problem creating the CSV file normally but I would like to insert comments and VBScript into the...
3
by: Steve | last post by:
Hi all, FileSystemObject question... I'm trying to check if files exist or not, but the files are not sitting on the same server as our Intranet. Basically we have about 5000 photos in a...
5
by: Brad Wood | last post by:
The delete method of the FileSystemObject.FileObject does not return a result. If permissions disallow deletion, it will not raise an error. Conversely, if the delete method does succeed, a call...
2
by: Sean S - Perth, WA | last post by:
Hi all, If I create a FileSystemObject Object is it appropriate to reuse it to perform operations on different files/folders? Or should I create a new FileSystemObject Object for each file and...
1
by: RdS | last post by:
Hello, I have been searching for what createfolder can return or does return. Where on MSDN can I find what a MS method returns? I have searched for filesystemobject.createfolder errors, error...
0
by: Amanda Byrne | last post by:
I'm trying to set up a simple guestbook script on my ASP-based site. The code is not working and is not throwing errors, and I suspect it is because the FileSystemObject is not liking the relative...
1
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
4
Stang02GT
by: Stang02GT | last post by:
Hey guys, I was asked to help solve an issue another developer was having and I personally don't know much about it so I am turning to you guys for a little help/guidance. My co-worker has...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.