在程序中对网页进行填充以实现自动登录

资源来自于下面的链接:

https://download.csdn.net/download/wangmoxhn/4297691

为了实现电子报税对本地登录信息的直接抓取,应用了上面的资源中提供的类。这个类的作用很黄很暴力,其名字为GD,这个类实现了对网页信息的取得与填写,与其后台配合的是一个xml文件。

   程序中用到了密码,税号与电话,这是登录电子税务局的账户内容,遗憾处是验证码功能还未能实现:    

       tr = new tab("password", 密码.Trim());
                        GD.tabs.Add(tr);
                        tr = new tab("UserId", 税号.Trim());
                        GD.tabs.Add(tr);
                        tr = new tab("czydm", 电话.Trim());
                        GD.tabs.Add(tr);
                                     XmlHelper.save(new site(url.Text.Trim(),"" , "", "", ""));
                    
                    
                    
                    //将信息填写入表中

                   url.Text = wb.Url.ToString();
                    string path = url.Text.Trim();
                    s = XmlHelper.getSite(path);//此处path链接对应的是电子报税的网页
                  
                    XmlHelper.getTabs(s.Url);
                    setTable(wb.Document); //将上述信息填写入网页中。
 

 

下面是此GD类的源代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; 
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;
using System.IO;
using System.Xml;
using System.Collections;
using System.Runtime.InteropServices;

namespace DyeingMIS
{
    public  class GD
    {
        public static BindingList<tab> tabs = new BindingList<tab>();
        public static string filepath="data.dat";
        public static string xmlpath = "data.xml";
        /// <summary>
        /// 气泡提示
        /// </summary>
        /// <param name="str"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool setTipMsg(string str, Control tb)
        {
            return setTipMsg(str, tb, 2000);
        }
        /// <summary>
        /// 气泡提示
        /// </summary>
        /// <param name="str"></param>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值