通过抓包获取到的字符串如jsonString所示,有对反序列化熟悉的同学能提供个类不
string jsonString = @"{
""black"": [],
""white"": [],
""contact"": [
{
""pinyin"": """",
""nickname"": ""r"",
""id"": 575056787,
""email"": ""codemo@126.com""
},
{
""pinyin"": """",
""nickname"": ""r6"",
""id"": 575074340,
""email"": ""codemo@163.com""
},
{
""pinyin"": """",
""nickname"": ""yi"",
""id"": 574975530,
""email"": ""codemo@qq.com""
},
{
""pinyin"": """",
""nickname"": ""小燕子"",
""id"": 585384353,
""email"": ""codemo22@163.com""
}
],
""group"": [],
""recent"": []
}";
#region 通讯录收取
string rg_count = "contact\": [[](?<count>.*?)[]]";
string[] k = EmailHelp.GetRegValue(jsonString, rg_count, "count");
string[] nickname = EmailHelp.GetRegValue(k[0], "nickname\":(?<nickname>.*?)[,]", "nickname");
string[] email = EmailHelp.GetRegValue(k[0], "email\":(?<email>.*?)[}]", "email");
string path = string.Format(@"C:\mail\" + "codemo@sohu.com");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
StreamWriter sw = new StreamWriter(path + '\\' + "sohuContacts.csv");
//列名更多http://www.cnblogs.com/poilsinai/
sw.WriteLine("昵称,邮件账号 ");
//遍历datatable导出数据
for (int i = 0; i < nickname.Length; i++)
{
StringBuilder sbText = new StringBuilder();
sbText.Append(nickname[i] + ',' + email[i]);
//写datatable的一行
sw.WriteLine(sbText.ToString());
}
sw.Flush();
sw.Close();
#endregion
如何得到sohu邮箱的联系人问题
精选 翻译上一篇:使用log4net配置相关信息
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Microsoft Outlook邮箱存储清理问题
记一次处理outlook邮箱存储空间占满问题
outlook microsoft 微软 -
springBoot实现邮箱的发送
springBoot简单发送邮箱
验证码 redis 发送邮件 -
android写入联系人Contacts的信息,包括联系人的姓名,联系方式和邮箱
1:androidmanifest.xml的内容<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cn.itcast.contacts" an
android mobile application encoding database -
如何保存联系人
这两天项目有个需求,可以对事务操作人进行 【新建联系人】【保存到已有联系人】【编辑联系人(xxx)】. 总结一下,日后备用。先看一下效果:
string null email integer action