会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
搬砖的L先生
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
5
6
7
8
9
2019年7月15日
C#在txt类文件中追加内容
摘要: 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)
2019年7月8日
C#取绝对值函数
摘要: 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)
2019年7月5日
C#将字符串格式化为Json
摘要: 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)
2019年6月28日
C#获取本机IP
摘要: 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)
2019年6月12日
C#解决窗体全屏遮住任务栏
摘要: this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea; 在初始话后添加这个即可实现,。。。。。。。。。。。。。。。
阅读全文
posted @ 2019-06-12 18:00 搬砖的L先生
阅读(2344)
评论(0)
推荐(0)
2019年6月11日
C#XmlDocument输出字符串
摘要: XmlDocument xmlDoc = new XmlDocument(); //假定该xmlDoc已经有内容; MemoryStream streamXml = new MemoryStream(); XmlTextWriter writer = new XmlTextWriter(stream
阅读全文
posted @ 2019-06-11 11:44 搬砖的L先生
阅读(2195)
评论(0)
推荐(1)
2019年6月10日
C#拷贝整个文件夹以及子目录和其中文件
摘要: 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)
2019年5月27日
C#递归拷贝文件夹下文件以及文件夹
摘要: 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)
2019年5月25日
C# 获取文件名、目录、后缀、无后缀文件名、扩展名
摘要: 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)
C#递归得到特定文件夹下问件
摘要: 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
公告