通过抓包获取到的字符串如jsonString所示有对反序列化熟悉的同学能提供个类不 string jsonString = @{ black: [] white: [] contact: [ { pinyin: nickname: r id: email: } { pinyin: nickname: r id: email: } { pinyin: nickname: yi id: email: } { pinyin: nickname: 小燕子 id: email: } ] group: [] recent: [] }; #region 通讯录收取 string rg_count = contact\: [[](?<count>*?)[]]; string[] k = EmailHelpGetRegValue(jsonString rg_count count) string[] nickname = EmailHelpGetRegValue(k[] nickname\:(?<nickname>*?)[] nickname) string[] email = EmailHelpGetRegValue(k[] email\:(?<email>*?)[}] email) string path = stringFormat(@C:\mail\ + ) if (!DirectoryExists(path)) { DirectoryCreateDirectory(path) } StreamWriter sw = new StreamWriter(path + \\ + sohuContactscsv) //列名 swWriteLine(昵称邮件账号 ) //遍历datatable导出数据 for (int i = ; i < nicknameLength; i++) { StringBuilder sbText = new StringBuilder() sbTextAppend(nickname[i] + + email[i]) //写datatable的一行 swWriteLine(sbTextToString()) } swFlush() swClose() #endregion |