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

FileInfo question


Hello,

I create a file using FileInfo by :
NewFile = new FileInfo(FileName);

and I got a parameter which tells me in which folder I need to place it
on my filesystem.
How can I implement it on C# if I am getting _folderName and by using
FileInfo instance ?

Thank u!
*** Sent via Developersdex http://www.developersdex.com ***
Feb 7 '08 #1
2 1414
Hi,

I do not understand what you need. If you are provided with a path and you
need to create a file you can use several ways to do that:

FileStream( path_supplied + "\\" + myfilename);
StreamWriter( path_supplied + "\\" + myfilename);

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"csharpula csharp" <cs*******@yahoo.comwrote in message
news:ev*************@TK2MSFTNGP05.phx.gbl...
>
Hello,

I create a file using FileInfo by :
NewFile = new FileInfo(FileName);

and I got a parameter which tells me in which folder I need to place it
on my filesystem.
How can I implement it on C# if I am getting _folderName and by using
FileInfo instance ?

Thank u!
*** Sent via Developersdex http://www.developersdex.com ***

Feb 7 '08 #2
FileInfo does not create the file if it does not exist. Did I misunderstand
your first statement?

If you want a full path based on _foldername and FileName, use
Path.Combine(_foldername, FileName).
"csharpula csharp" wrote:
>
Hello,

I create a file using FileInfo by :
NewFile = new FileInfo(FileName);

and I got a parameter which tells me in which folder I need to place it
on my filesystem.
How can I implement it on C# if I am getting _folderName and by using
FileInfo instance ?

Thank u!
*** Sent via Developersdex http://www.developersdex.com ***
Feb 7 '08 #3

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

Similar topics

5
by: jman | last post by:
I have an urgent question. I have written a .Net C# windows services that has only one key purpose: to move files from the machine that is running the service to a network download server for...
2
by: John Bowman | last post by:
Hi All, ..NET 1.1... I'm wondering if there is any approach more convenient to get a list of FileInfo objects than the following. For example, if I wanted to get 1 list of all the Exe's and all...
1
by: COHENMARVIN | last post by:
I am trying to display the contents of a directory in a listbox. I manage to get an array of fileInfo objects, and when I print them out they indeed contain several file names. But when I do...
5
by: Lance | last post by:
I want to expose properties of a class to a user via a PropertyGrid class. Some of the properties are of type System.IO.FileInfo. Ideally, an OpenFileDialog window would appear when the user...
1
by: Benjamin | last post by:
I am trying to make a file I created a hidden file. I think I need to use the setfileattribute() but I cannot find it anywhere. I found this on msdn:...
1
by: Tim Failes | last post by:
This seems a trival question, but I cannot get it to work properly... Essentially my question is, how can I create a text file, and guarantee it is given the current date/time as the Creation Time?...
3
by: rn5a | last post by:
To work with files, when should one use the File class & when should one use the FileInfo class? Similarly, to work with directories, when should one use the Directory class & when should one...
0
by: comp.lang.php | last post by:
if (!function_exists('mime_content_type_fileinfo')) { /** * Will use {@link http://us2.php.net/fileinfo FileInfo} functions provided within {@link http://pecl.php.net PECL} bundle to return mime...
6
by: fyitang | last post by:
hi guys, here is the sample: string strFileFullName = ""; try { FileInfo currentFile = GetOneFile("some directory"); strFileFullName = currentFile.FullName; // do someting...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.