Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. urgent -- file creation in c#

urgent -- file creation in c#

Scheduled Pinned Locked Moved C#
csharphelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chithra Anoop
    wrote on last edited by
    #1

    I want to create files with different names in c#. It should be in the form 0001.9001 0001.9002 0001.9003 0001.9004 0001.9005 0002.9001 0002.9002 0002.9003 0002.9004 0002.9005 0003.9001 0003.9002 .... 0009.9005 0010.9001 etc.... This much I could do. If the program creates a particular file name, when the program runs next time it should not create the same file name. Instead it should start the file creation as the continuation of the previous file name. Can I do it with any file operation.Please help me to find out the coding for this. Thank you for your time and support

    M 1 Reply Last reply
    0
    • C Chithra Anoop

      I want to create files with different names in c#. It should be in the form 0001.9001 0001.9002 0001.9003 0001.9004 0001.9005 0002.9001 0002.9002 0002.9003 0002.9004 0002.9005 0003.9001 0003.9002 .... 0009.9005 0010.9001 etc.... This much I could do. If the program creates a particular file name, when the program runs next time it should not create the same file name. Instead it should start the file creation as the continuation of the previous file name. Can I do it with any file operation.Please help me to find out the coding for this. Thank you for your time and support

      M Offline
      M Offline
      Mbah Dhaim
      wrote on last edited by
      #2
      1. never write "URGENT", coz we don't care if this urgent or not :-\ 2) store your last file name (in registry, configuration file, etc.) 3) increment filename as you wish then store it agains hope it helps

      dhaim programming is a hobby that make some money as side effect :)

      C 1 Reply Last reply
      0
      • M Mbah Dhaim
        1. never write "URGENT", coz we don't care if this urgent or not :-\ 2) store your last file name (in registry, configuration file, etc.) 3) increment filename as you wish then store it agains hope it helps

        dhaim programming is a hobby that make some money as side effect :)

        C Offline
        C Offline
        Chithra Anoop
        wrote on last edited by
        #3

        This is my first program in c#. I got the logic, but lack with the features and code. Can u plz help me with the code Thank you for your response...

        T 1 Reply Last reply
        0
        • C Chithra Anoop

          This is my first program in c#. I got the logic, but lack with the features and code. Can u plz help me with the code Thank you for your response...

          T Offline
          T Offline
          That Asian Guy
          wrote on last edited by
          #4

          using (StreamWriter sw = File.CreateText(fileName))
          {
          sw.Write(data);
          }

          using (StreamReader sr = File.OpenText(fileName))
          {
          String contents = sr.ReadToEnd();
          }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups