FileInfo question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csharpula csharp

    FileInfo question


    Hello,

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

    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 ***
  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: FileInfo question

    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
    The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

    Mobile & warehouse Solutions.
    "csharpula csharp" <csharpula@yaho o.comwrote in message
    news:evydL0aaIH A.992@TK2MSFTNG P05.phx.gbl...
    >
    Hello,
    >
    I create a file using FileInfo by :
    NewFile = new FileInfo(FileNa me);
    >
    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 ***

    Comment

    • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

      #3
      RE: FileInfo question

      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(_f oldername, FileName).


      "csharpula csharp" wrote:
      >
      Hello,
      >
      I create a file using FileInfo by :
      NewFile = new FileInfo(FileNa me);
      >
      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 ***
      >

      Comment

      Working...