473,386 Members | 1,997 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,386 software developers and data experts.

Error Creating TXT File

Private Sub find_file(ByVal strFile)
Dim Path As String
Dim NewFile As StreamWriter

strFile = "Extern\" & strFile
Path = Server.MapPath(strFile)
If Not File.Exists(Path ) Then
NewFile = File.CreateText(Path )
NewFile .Close()
End If
End Sub
I have this to find (and create, if not found) a file. The problem is that
it's not working.
It gives me an error like this:
Access to the path "c:\(all path)\Extern\novo.txt" is denied

I think that I have to set permissions, but where??? I already put the Read
an Write Permissions for that application in IIS, and in the right path too.

How can I set this up?
It's missing anything?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #1
3 1209
Hi, ruca,

You should allow Modify and Write rights to the local ASPNET account for
that folder. In the Windows Explorer right-click and choose Properties and
then choose the tab Security. If you don't see the ASPNET account in the
list add it.

Hope this helps
Martin
"ruca" <ru***@iol.pt> wrote in message
news:u7**************@TK2MSFTNGP12.phx.gbl...
Private Sub find_file(ByVal strFile)
Dim Path As String
Dim NewFile As StreamWriter

strFile = "Extern\" & strFile
Path = Server.MapPath(strFile)
If Not File.Exists(Path ) Then
NewFile = File.CreateText(Path )
NewFile .Close()
End If
End Sub
I have this to find (and create, if not found) a file. The problem is that
it's not working.
It gives me an error like this:
Access to the path "c:\(all path)\Extern\novo.txt" is denied

I think that I have to set permissions, but where??? I already put the Read an Write Permissions for that application in IIS, and in the right path too.
How can I set this up?
It's missing anything?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Nov 18 '05 #2
Ok, it works!!!
Now I have another thing.... It's to Read each line of that TXT file. For
that I have this:

Function ReadTXT()
Dim stmReader As StreamReader
Dim Path As String

Path = Server.MapPath("Extern\novo.txt")

VerUser = File.OpenText(LerPath)
While Not VerUser.ReadToEnd()
txtLine = VerUser.ReadLine()
'then I have code here but it's only to format the sesult line
End While
End Function

txtLine result is always Nothing and because of that the While instruction
don't end.
Can you help me?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Martin Dechev" <de*******@hotmail.com> escreveu na mensagem
news:OC**************@TK2MSFTNGP09.phx.gbl...
Hi, ruca,

You should allow Modify and Write rights to the local ASPNET account for
that folder. In the Windows Explorer right-click and choose Properties and
then choose the tab Security. If you don't see the ASPNET account in the
list add it.

Hope this helps
Martin
"ruca" <ru***@iol.pt> wrote in message
news:u7**************@TK2MSFTNGP12.phx.gbl...
Private Sub find_file(ByVal strFile)
Dim Path As String
Dim NewFile As StreamWriter

strFile = "Extern\" & strFile
Path = Server.MapPath(strFile)
If Not File.Exists(Path ) Then
NewFile = File.CreateText(Path )
NewFile .Close()
End If
End Sub
I have this to find (and create, if not found) a file. The problem is that it's not working.
It gives me an error like this:
Access to the path "c:\(all path)\Extern\novo.txt" is denied

I think that I have to set permissions, but where??? I already put the

Read
an Write Permissions for that application in IIS, and in the right path

too.

How can I set this up?
It's missing anything?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca



Nov 18 '05 #3
Hi, ruca,

The MSDN documentation is full of examples, just browse around the classes
you use.

Anyway, try adapting this example for your needs:

http://msdn.microsoft.com/library/en...xtfromfile.asp

Hope this helps
Martin
"ruca" <ru***@iol.pt> wrote in message
news:uK**************@TK2MSFTNGP09.phx.gbl...
Ok, it works!!!
Now I have another thing.... It's to Read each line of that TXT file. For
that I have this:

Function ReadTXT()
Dim stmReader As StreamReader
Dim Path As String

Path = Server.MapPath("Extern\novo.txt")

VerUser = File.OpenText(LerPath)
While Not VerUser.ReadToEnd()
txtLine = VerUser.ReadLine()
'then I have code here but it's only to format the sesult line
End While
End Function

txtLine result is always Nothing and because of that the While instruction
don't end.
Can you help me?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Martin Dechev" <de*******@hotmail.com> escreveu na mensagem
news:OC**************@TK2MSFTNGP09.phx.gbl...
Hi, ruca,

You should allow Modify and Write rights to the local ASPNET account for
that folder. In the Windows Explorer right-click and choose Properties and
then choose the tab Security. If you don't see the ASPNET account in the
list add it.

Hope this helps
Martin
"ruca" <ru***@iol.pt> wrote in message
news:u7**************@TK2MSFTNGP12.phx.gbl...
Private Sub find_file(ByVal strFile)
Dim Path As String
Dim NewFile As StreamWriter

strFile = "Extern\" & strFile
Path = Server.MapPath(strFile)
If Not File.Exists(Path ) Then
NewFile = File.CreateText(Path )
NewFile .Close()
End If
End Sub
I have this to find (and create, if not found) a file. The problem is that it's not working.
It gives me an error like this:
Access to the path "c:\(all path)\Extern\novo.txt" is denied

I think that I have to set permissions, but where??? I already put the

Read
an Write Permissions for that application in IIS, and in the right

path too.

How can I set this up?
It's missing anything?
--

Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca




Nov 18 '05 #4

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

Similar topics

1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
5
by: azgoddess1 | last post by:
During the installation I get these error messages: ***** SQL1390C The environment variable DB2Instance is not defined or is invalid An error ocured while loading the command "C:\Program...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
0
by: Kevin | last post by:
I'm writing a service in VB.NET. Reference the following code: Dim oStreamWriter As StreamWriter .... .... .... oStreamWriter = File.CreateText(TempLogFile) If Err.Number <> 0 Then...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
by: Herman Jones | last post by:
I'm getting the following error when I build a Class Library project: Embedding manifest... Project : error PRJ0002 : Error result 1 returned from 'C:\WINDOWS\system32\cmd.exe'. It happens with...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
1
yabansu
by: yabansu | last post by:
Hi all, I implemented a basic client application. It communicates with server and works properly. Building processes succeed just by giving the following warning: LINK : D:\DOC\Visual Studio...
0
by: palmem | last post by:
I am trying to write a simple FTP server in order to learn about sockets This is my first time trying sockets This code should take a connection on port 8110, dump it to a client "thread" (not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.