Hello,
I need to save some information into a text file.
For this, I use :
FileOpen(1, "c:\MyFile.txt", OpenMode.Output)
For I = 0 To iCpt - 1
WriteLine(1, myDs.Tables(0).Rows(I).Item("MyText"))
Next
FileClose(1)
This is running...
BUT I would like to save the text file into "My Documents" of user whos run
application.
--> In place of : FileOpen(1, "c:\MyFile.txt", OpenMode.Output)
--> I would like : FileOpen(1,"c:\Documents and settings\[USER]\My
Documents", OpenMode.Output)
How know ?
Thanks
Ben 4 6480
Ben,
try
Environment.GetFolderPath(Environment.SpecialFolde r.Personal)
to get that path.
Klaus
"Ben" <be*******@hotmail.com> schrieb im Newsbeitrag
news:ev**************@TK2MSFTNGP10.phx.gbl... Hello,
I need to save some information into a text file. For this, I use :
FileOpen(1, "c:\MyFile.txt", OpenMode.Output) For I = 0 To iCpt - 1 WriteLine(1, myDs.Tables(0).Rows(I).Item("MyText")) Next FileClose(1)
This is running...
BUT I would like to save the text file into "My Documents" of user whos
run application. --> In place of : FileOpen(1, "c:\MyFile.txt", OpenMode.Output) --> I would like : FileOpen(1,"c:\Documents and settings\[USER]\My Documents", OpenMode.Output)
How know ?
Thanks
Ben
"Ben" <be*******@hotmail.com> schrieb Hello,
I need to save some information into a text file. For this, I use :
FileOpen(1, "c:\MyFile.txt", OpenMode.Output) For I = 0 To iCpt - 1 WriteLine(1, myDs.Tables(0).Rows(I).Item("MyText")) Next FileClose(1)
This is running...
BUT I would like to save the text file into "My Documents" of user whos run application. --> In place of : FileOpen(1, "c:\MyFile.txt", OpenMode.Output) --> I would like : FileOpen(1,"c:\Documents and settings\[USER]\My Documents", OpenMode.Output)
How know ?
dim Dirname, fullname as string
Dirname = Environment.GetFolderPath( _
Environment.SpecialFolder.Personal _
)
fullname = io.path.combine(dirname, "myfile.txt")
--
Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
Hi Ben BUT I would like to save the text file into "My Documents" of user whos
run application.
dim Myfolder as string =
Environment.GetFolderPath(Environment.SpecialFolde r.Personal)
I hope this helps?
Cor
THANKS !!!
It's running...
"Armin Zingler" <az*******@freenet.de> a écrit dans le message de news:
40***********************@news.freenet.de... "Ben" <be*******@hotmail.com> schrieb Hello,
I need to save some information into a text file. For this, I use :
FileOpen(1, "c:\MyFile.txt", OpenMode.Output) For I = 0 To iCpt - 1 WriteLine(1, myDs.Tables(0).Rows(I).Item("MyText")) Next FileClose(1)
This is running...
BUT I would like to save the text file into "My Documents" of user whos run application. --> In place of : FileOpen(1, "c:\MyFile.txt", OpenMode.Output) --> I would like : FileOpen(1,"c:\Documents and settings\[USER]\My Documents", OpenMode.Output)
How know ?
dim Dirname, fullname as string
Dirname = Environment.GetFolderPath( _ Environment.SpecialFolder.Personal _ )
fullname = io.path.combine(dirname, "myfile.txt")
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jim Hill |
last post by:
I've done some Googling around on this and it seems like creating a here
document is a bit tricky with Python. Trivial via triple-quoted strings...
|
by: Grant_S |
last post by:
I need to identify the path to a users "My Document" folder where the
user has a roaming profile and their "My Documents" folder is mapped to
a...
|
by: jj |
last post by:
How do I programatically default the encoding of my "Notepad" into ANSI.
My application uses notepad to save some text. Some of the client computers...
|
by: JuLiE Dxer |
last post by:
Is there a way via C# to programmatically retrieve the full path name
to folders like "My Documents" ??
I'm seeing examples with the use of...
|
by: Tony Nelson |
last post by:
On *nix, ~/foo refers to a file in a user's home directory. On
MSWindows, users normally look at "My Documents" in their home
directory. ISTM...
|
by: Jeremy |
last post by:
I don't know if this is really a javascript question but thought I may
as well start here...
I know that a "document" is what is displayed in a...
|
by: Martin Jørgensen |
last post by:
Hi,
I'm trying to move a matlab program into c language. For those who knows
matlab, this is the line I want to program in c:
hx(1:nx,1:ny) =...
|
by: Franky |
last post by:
I know about GetModuleFileName but what I need is a similar call to get the
folder "My Documents"
Is there such a thing?
Thanks
|
by: Jack |
last post by:
Hi there,
In a submit button event, I need to open a (server-side) file relative to
the folder containing the ".aspx" file. What's the correct...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...
| |