目前在老家出差,老家电网改造,使用了智能电表,把老式电表全部换了还给了一个客户号,

到头来也得以在支付宝怎么的交电费了,但大家那边支付宝还不可以查询剩余多少钱,那令人很恼火,

于是就来国家电网http://www.95598.cn/person/index.shtml
查询了一晃,发现必要客户号、查询密码、验证码,客户号自身驾驭,查询密码是不清楚的,随便输入,提醒错误,

于是乎打95598问了下客服,得知了默许密码是6个8,查询了弹指间,出来新闻了,但想每回都上电脑上查,貌似有些不便于,就想协调做一个模仿提交的,

宪章提交即将解决验证码识其他标题,看看也不复杂,就捣鼓了一会,然后分析提交的信息及url,

下一场看到一个http://www.95598.cn/95598/per/shortCut/getShortCutAccount
这几个地方,只传了2个参数,一个客户号,还有一个不通晓是什么样,

就径直测试了下这几个url,post提交了三个参数,然后如故音讯直接出来了,

要么josn格式。。。客户名称、电表地址、电表号,余额、违约金、欠费新闻,还有部分项目标客户居然还带如今的电费记录,

到那自己就想问特么你以前验证的查询密码和验证码了 干什么用的?
只是个慌子吗?我书都的少,你别骗我,這么大一个国家电网,居然这么些查询密码是个渣?

好吧 代码我也上上来吗,但没关系技术含量了

/// <summary>
        /// 获取电费
        /// </summary>
        /// <param name="consNo">客户号</param>
        /// <returns></returns>
        public static void GetPowerRate<T>(T consNo)
        {
            HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.95598.cn/95598/per/shortCut/getShortCutAccount");
            httpWebRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
            httpWebRequest.Method = "POST";
            var data = System.Text.Encoding.UTF8.GetBytes(string.Format("consNo={0}&orgNo=43101", consNo));
            using (Stream stream = httpWebRequest.GetRequestStream())
            {
                stream.Write(data, 0, data.Length);
                stream.Close();
            }
            data = null;
            Result result = new Result();
            try
            {
                HttpWebResponse webResponse = httpWebRequest.GetResponse() as HttpWebResponse;
                using (System.IO.StreamReader stream = new StreamReader(webResponse.GetResponseStream()))
                {
                    result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result>(stream.ReadToEnd());
                }
                httpWebRequest = null;
                webResponse.Close();
                webResponse = null;
            }
            catch { }
            result.billInfo.consNo = consNo.ToString();
            Write(result);
        }

返回json 示例:

"{\"statusCode\":200,\"orgNo\":\"43101\",\"billInfo\":{\"errorCode\":null,\"count\":\"21\",\"errorMessage\":null,\"orgNo\":\"xxx52\",\"consNo\":\"1xxx4\",\"consName\":\"唐xx\",\"elecAddr\":\"岳麓-长沙市岳麓区望岳路xxx\",\"consSortCode\":\"城网低压居民\",\"rtnCode\":null,\"rtnMsg\":null,\"acctOrgNo\":null,\"purchaseType\":\"普通缴费\",\"balLists\":[
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000360600225\",\"rcvblAmt\":\"27.64\",\"owePenalty\":\"0\",\"rcvedAmt\":\"27.64\",\"oweAmt\":\"0\",\"rcvblYm\":\"201412\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000384456503\",\"rcvblAmt\":\"27.64\",\"owePenalty\":\"0\",\"rcvedAmt\":\"27.64\",\"oweAmt\":\"0\",\"rcvblYm\":\"201501\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000417908221\",\"rcvblAmt\":\"1.76\",\"owePenalty\":\"0\",\"rcvedAmt\":\"1.76\",\"oweAmt\":\"0\",\"rcvblYm\":\"201503\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000458719783\",\"rcvblAmt\":\"32.93\",\"owePenalty\":\"0\",\"rcvedAmt\":\"32.93\",\"oweAmt\":\"0\",\"rcvblYm\":\"201505\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000475907830\",\"rcvblAmt\":\"33.52\",\"owePenalty\":\"0\",\"rcvedAmt\":\"33.52\",\"oweAmt\":\"0\",\"rcvblYm\":\"201506\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000494109461\",\"rcvblAmt\":\"114.13\",\"owePenalty\":\"0\",\"rcvedAmt\":\"114.13\",\"oweAmt\":\"0\",\"rcvblYm\":\"201507\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000517111477\",\"rcvblAmt\":\"84.67\",\"owePenalty\":\"0\",\"rcvedAmt\":\"5.87\",\"oweAmt\":\"78.8\",\"rcvblYm\":\"201508\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000400353270\",\"rcvblAmt\":\"11.76\",\"owePenalty\":\"0\",\"rcvedAmt\":\"11.76\",\"oweAmt\":\"0\",\"rcvblYm\":\"201502\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2015000435879133\",\"rcvblAmt\":\"8.23\",\"owePenalty\":\"0\",\"rcvedAmt\":\"8.23\",\"oweAmt\":\"0\",\"rcvblYm\":\"201504\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2013000201613636\",\"rcvblAmt\":\"148.59\",\"owePenalty\":\"0\",\"rcvedAmt\":\"148.59\",\"oweAmt\":\"0\",\"rcvblYm\":\"201312\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000206170080\",\"rcvblAmt\":\"288.76\",\"owePenalty\":\"0\",\"rcvedAmt\":\"288.76\",\"oweAmt\":\"0\",\"rcvblYm\":\"201401\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000213433834\",\"rcvblAmt\":\"178.57\",\"owePenalty\":\"0\",\"rcvedAmt\":\"178.57\",\"oweAmt\":\"0\",\"rcvblYm\":\"201402\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000220409307\",\"rcvblAmt\":\"0.59\",\"owePenalty\":\"0\",\"rcvedAmt\":\"0.59\",\"oweAmt\":\"0\",\"rcvblYm\":\"201403\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000224346917\",\"rcvblAmt\":\"9.41\",\"owePenalty\":\"0\",\"rcvedAmt\":\"9.41\",\"oweAmt\":\"0\",\"rcvblYm\":\"201404\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000235525969\",\"rcvblAmt\":\"22.34\",\"owePenalty\":\"0\",\"rcvedAmt\":\"22.34\",\"oweAmt\":\"0\",\"rcvblYm\":\"201405\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000250824152\",\"rcvblAmt\":\"24.7\",\"owePenalty\":\"0\",\"rcvedAmt\":\"24.7\",\"oweAmt\":\"0\",\"rcvblYm\":\"201406\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000265451425\",\"rcvblAmt\":\"32.34\",\"owePenalty\":\"0\",\"rcvedAmt\":\"32.34\",\"oweAmt\":\"0\",\"rcvblYm\":\"201407\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000287619069\",\"rcvblAmt\":\"100.55\",\"owePenalty\":\"0\",\"rcvedAmt\":\"100.55\",\"oweAmt\":\"0\",\"rcvblYm\":\"201408\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000302284130\",\"rcvblAmt\":\"97.02\",\"owePenalty\":\"0\",\"rcvedAmt\":\"97.02\",\"oweAmt\":\"0\",\"rcvblYm\":\"201409\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000329656994\",\"rcvblAmt\":\"34.1\",\"owePenalty\":\"0\",\"rcvedAmt\":\"34.1\",\"oweAmt\":\"0\",\"rcvblYm\":\"201410\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null},
{\"statusCode\":\"非锁定\",\"rcvblAmtId\":\"2014000342784003\",\"rcvblAmt\":\"23.52\",\"owePenalty\":\"0\",\"rcvedAmt\":\"23.52\",\"oweAmt\":\"0\",\"rcvblYm\":\"201411\",\"rcvedPenalty\":null,\"billType\":\"正常电费\",\"addBal\":null}],
\"acctBal\":\"0\",\"chargeBal\":null,\"freezeBal\":null,\"oweAmtSum\":\"78.8\",\"owePenaltySum\":\"0\",\"purchaseInfos\":null,\"levDisBeginYm\":null,\"levDisEndYm\":null,\"levDisAmt\":null,\"isLevDisFlag\":null,\"limitReason\":null},\"date\":\"2015-08-18\"}"////

示范中有的音讯被我用xx代替了,

字段表明:

consN(客户号)、consName(客户姓名)、elecAddr(电表地址)、consSortCode类型、
acctBal(账户余额)、oweAmtSum(账户欠费)、

statusCode 固定为200 不管客户号有没有都是200 
然后就是billInfo新闻中倘诺consNo(客户号)为null则意味平昔不客户,

山乡的归来稍微有点同样,但第一音讯都有,前几天不捣鼓了,洗洗睡了

 

相关文章

网站地图xml地图