Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

FileInfo question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
csharpula csharp - 07 Feb 2008 17:15 GMT
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!
Ignacio Machin ( .NET/ C# MVP ) - 07 Feb 2008 18:17 GMT
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);

Signature

Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.

>
> Hello,
[quoted text clipped - 10 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
zacks@construction-imaging.com - 07 Feb 2008 18:49 GMT
> Hello,
>
[quoted text clipped - 5 lines]
> How can I  implement it on C# if I am getting _folderName and by using
> FileInfo instance ?

It's news to me that the FileInfo Class can create a new file. From my
understanding, it only works with an existing file to obtain the file
properties of the file.
Family Tree Mike - 07 Feb 2008 18:54 GMT
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).

> Hello,
>
[quoted text clipped - 9 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.