Some of the knowledge points used in this recent program are hereby recorded for future use! 1. Method for Testing the code execution time [csharp] Stopwatch sw = new Stopwatch (); sw. start (); // enter the code sw to be executed here. stop (); Console. writeLine ("total running time:" + sw. elapsed); Console. writeLine ("the total running time (in milliseconds) of the measurement instance:" + sw. elapsedMilliseconds); Console. writeLine ("total running time (timer scale ID):" + sw. elapsedTicks); Console. writeLine ("Whether the timer is running:" + sw. isRunning. toString (); 2. File Path and file name string truncation and replacement operation method [html] string filePath = @ "E: \ Randy0528 \ Chinese directory \ JustTest.rar"; Respo Neuron. Write ("file path:" + filePath); Response. Write ("<br/> change the extension of the path string. <Br/> "); Response. write (System. IO. path. changeExtension (filePath, "txt"); Response. write ("<br/> returns the directory information of the specified path string .. <Br/> "); Response. Write (System. IO. Path. GetDirectoryName (filePath); Response. Write (" <br/> return the extension of the specified Path string. <Br/> "); Response. write (System. IO. path. getExtension (filePath); Response. write ("<br/> returns the name and extension of the specified path string. <Br/> "); Response. write (System. IO. path. getFileName (filePath); Response. write ("<br/> returns the file name of the specified path string without the extension. <Br/> "); Response. Write (System. IO. Path. GetFileNameWithoutExtension (filePath); Response. Write (" <br/> get the root directory information of the specified Path. <Br/> "); Response. Write (System. IO. Path. GetPathRoot (filePath); Response. Write (" <br/> return the random folder name or file name. <Br/> "); Response. write (System. IO. path. getRandomFileName (); Response. write ("<br/> create a temporary file named zero byte on the disk and return the complete path of the file. <Br/> "); Response. Write (System. IO. Path. GetTempFileName (); Response. Write (" <br/> return the Path of the temporary folder of the current System. <Br/> "); Response. Write (System. IO. Path. GetTempPath (); Response. Write (" <br/> determine whether the Path includes the file extension. <Br/> "); Response. write (System. IO. path. hasExtension (filePath); Response. write ("<br/> gets a value that indicates whether the specified path string contains absolute or relative path information. <Br/> "); Response. write (System. IO. path. isPathRooted (filePath); 3. System. IO. streamWriter writes a file line feed [html] StreamWriter swPdfChange = new StreamWriter (txtfilename, false, Encoding. UTF8); swPdfChange. write ("baPWV:" + str1 + "" + str2 + "\ r \ nABI:" + str3); swPdfChange. close (); [csharp] StreamWriter swPdfChange = new StreamWriter (txtfilename, false, Encoding. UTF8); swPdfChange. writeLine ("baPWV:" + str1 + "" + str2); swPdfChange. writeLine ("ABI:" + str3); swPdfChange. close (); 4. console with parameter program [csharp] using System; using System. collections. generic; using System. linq; using System. text; namespace _ 1 {class Program {static void Main (string [] args) {if (args. length <1) {Console. writeLine ("Enter the parameter-a-v \" a s \ "");} else {foreach (string key in args) {if (key = "a s ") {Console. writeLine ("This is 'a s' parameters");} else if (key = "-a") {Console. writeLine ("This is 'A' parameters");} else if (key = "-v") {Console. writeLine ("This is 'V' parameters");} else {Console. writeLine ("parameter error ");}}}}}}