首页 >  软件编程 > 正文

邮件检查程序

标签: 代码


mailcheck program

//姓名列表存在namelist.txt文档中,供以后处理方便
var text = File.ReadAllText("namelist.txt");

//执行读取操作
using (var reader = new StringReader(text))
{
    ReadNames(reader);
}   

//此处使用异步获取方式 防止程序的卡顿
public async void ReadNames(StringReader reader)
{
    string str;
    while ((str = await reader.ReadLineAsync()) != null)
    {
        if (String.IsNullOrWhiteSpace(str))
            continue;
        nameList.Add(str.Trim());
    }
}

原创文章,转载请注明出处!
本文链接:https://yangfeileo.github.io/posts/program-mailcheck.html
上篇: why we code
下篇: mac直接删除文件