
c#
Eiffai
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C# 多个进程/程序读写文件 解决办法
问题描述在多个C#程序操作同一个文件的时候,当一个C#正在读此文件,另一个C#程序想要写此文件,此时会报错。`Exception:文件"xxx"正由另一进程使用,因此该进程无法访问此文件。`问题代码读文件的代码using (StreamReader sr = new StreamReader(file_name)){ Thread.Sleep(100000);}写文件代码using (StreamWriter sr = new StreamWriter(file_name, t原创 2020-09-28 16:58:04 · 2565 阅读 · 0 评论 -
c# get set方法简述
先上声明一个类的代码public class MyClass{ // this is a field. It is private to your class and stores the actual data. private string _myField; // this is a property. When you access it uses t原创 2018-01-31 15:36:11 · 522 阅读 · 0 评论