Home > Net >  C # how to obtain a CSV file name and change
C # how to obtain a CSV file name and change

Time:09-28

Here have a lot of the CSV file is automatically generated according to the time, every CSV file has a different id, I want to take the CSV inside content into a CSV file name, CSV file name is not fixed, for example, 20191011120354. The CSV to each file corresponding to the id. CSV

CodePudding user response:

Change the File with the File. Move
Read and write text files in the File. The File and ReadAllText. WriteAllText

CodePudding user response:

reference 1st floor github_36000833 response:
changed files in the File. The Move
Read and write text files in the File. ReadAllText and File. WriteAllText

Bosses, please point in more detail? Please hold thigh

CodePudding user response:

First open the File access to the id, and then close the File, then renamed, CSV can be read by the text File, the File name can call the Move

CodePudding user response:

reference volunteergg reply: 3/f
open the File access to id first, and then close the File, then renamed, CSV can be read as a text File, the File name can call. Move

The first step you how to open the file access id?

CodePudding user response:

Weixin_45806276
reference 4 floor response:
Quote: refer to the third floor volunteergg response:
open the File access to id first, and then close the File, then renamed, CSV can be read as a text File, the File name can call. Move

The first step you how to open the file access id?



Use of StreamReader object, can go to check the MSDN usage

CodePudding user response:

Com bag inside a VB library with a computer inside library is simply a DLL. There is a File rename so easy but may be more than a cross-platform if PC. Net core didn't try

CodePudding user response:

Regular expression to replace the file with a Move to modify again
  •  Tags:  
  • C#
  • Related