1 代码
1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace ConsoleApplication4 9 { 10 class Program 11 { 12 static void Main(string[] args) 13 { //这个路径的最后一定要有一个\ 14 string path = @"D:\用户目录\我的文档\visual studio 2015\Projects\ConsoleApplication4\ConsoleApplication4\"; 15 string fileName = @"1.txt"; 16 string full = Path.Combine(path, fileName); 17 Console.WriteLine(full); 18 Console.ReadKey(); 19 } 20 } 21 }
2 效果
时间: 2024-10-13 09:16:56