上一页 1 ··· 5 6 7 8 9
摘要: string path = "test.txt"; FileStream mystream = new FileStream(path, FileMode.OpenOrCreate); StreamWriter myWrite = new StreamWriter(mystream); myWrit 阅读全文
posted @ 2019-07-15 09:37 搬砖的L先生 阅读(3763) 评论(0) 推荐(0)
摘要: System.Math.Abs(float value); System.Math.Abs(decimal value); System.Math.Abs(int value); System.Math.Abs(double value); System.Math.Abs(sbyte value); 阅读全文
posted @ 2019-07-08 17:46 搬砖的L先生 阅读(3535) 评论(0) 推荐(0)
摘要: private string ConvertStringToJson(string str) { //格式化json字符串 JsonSerializer serializer = new JsonSerializer(); TextReader tr = new StringReader(str); 阅读全文
posted @ 2019-07-05 11:43 搬砖的L先生 阅读(2341) 评论(0) 推荐(0)
摘要: public void GetIPAddress() { string resultIP = string.Empty; System.Net.IPAddress[] ips = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).Ad 阅读全文
posted @ 2019-06-28 14:54 搬砖的L先生 阅读(1646) 评论(0) 推荐(0)
摘要: this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea; 在初始话后添加这个即可实现,。。。。。。。。。。。。。。。 阅读全文
posted @ 2019-06-12 18:00 搬砖的L先生 阅读(2344) 评论(0) 推荐(0)
摘要: XmlDocument xmlDoc = new XmlDocument(); //假定该xmlDoc已经有内容; MemoryStream streamXml = new MemoryStream(); XmlTextWriter writer = new XmlTextWriter(stream 阅读全文
posted @ 2019-06-11 11:44 搬砖的L先生 阅读(2195) 评论(0) 推荐(1)
摘要: private void CopyDirectory(string srcPath, string desPath) { string folderName = srcdir.Substring(srcdir.LastIndexOf("\\")+1); string desfolderdir = d 阅读全文
posted @ 2019-06-10 13:33 搬砖的L先生 阅读(3999) 评论(0) 推荐(0)
摘要: public bool CopyOldLabFilesToNewLab(string sourcePath, string savePath) { if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } #r 阅读全文
posted @ 2019-05-27 16:40 搬砖的L先生 阅读(896) 评论(0) 推荐(0)
摘要: string filePath = "C:\\1.txt"; string str = "获取文件的全路径:" + Path.GetFullPath(filePath); //-->C:1.txt str = "获取文件所在的目录:" + Path.GetDirectoryName(filePath 阅读全文
posted @ 2019-05-25 13:53 搬砖的L先生 阅读(9840) 评论(0) 推荐(1)
摘要: List<String> listFile = new List<String>(); public void director(string path) { //绑定到指定的文件夹目录 DirectoryInfo dir = new DirectoryInfo(path); //检索表示当前目录的 阅读全文
posted @ 2019-05-25 12:00 搬砖的L先生 阅读(512) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9