![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
纳米时速
这个作者很懒,什么都没留下…
展开
-
C# using使用简析
C#using的使用转载 2017-05-09 19:41:37 · 405 阅读 · 0 评论 -
C#检测同个程序被打开或运行多次
有时在做一个C#的程序时,你并不希望用户重复打开多个,为了避免程序被重复打开所带来的不确定因素,就需要在程序运行前做一些处理,来提示使用者。这里提供一种方法,亲测有效。在项目的第一个窗体的启动事件中 如form1_load() 中添加如下语句 //获取指定的进程名 System.Diagnostics.Process[] myProcesses = Sy转载 2017-10-19 13:55:31 · 3393 阅读 · 1 评论 -
C# 使用System.IO.File.Create
在一个程序里偶然用了System.IO.File.Create去创建文件,运行时一直报错(进程被占用),后来在网上找到了解决办法,引用了一下。winfrom中操作文件:判断是否有当前的文件存在,不存在则进行创建,在进行操作;Code:if(!System.IO.File.Exists(fileName)){System.IO.File.Create(file转载 2017-11-21 14:10:47 · 5184 阅读 · 0 评论 -
C# 设置文件权限
//设置权限public void addpathPower(string pathname, string username, string power){DirectoryInfo dirinfo = new DirectoryInfo(pathname);if ((dirinfo.Attributes & FileAttributes.ReadOnly) != 0)转载 2017-11-21 17:23:28 · 1356 阅读 · 0 评论