• 大小: 0.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-29
  • 语言: C#
  • 标签: 获取  打开  源码  网页  C#  

资源简介

C#打开与获取网页源码

资源截图

代码片段和文件信息

using Imitate;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.IO.Compression;
using System.Text.Regularexpressions;
namespace Imitate
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender EventArgs e)
        {
            webBrowser1.scriptErrorsSuppressed = true; //屏蔽错误信息 C# 系统组件
            webBrowser1.Navigate(“https://wxtz.rsmkcq.com/?jump=aHR0cHM6Ly84ODMyMnguY29tP3JpZD05OTQ0NjMmdHlwZTE9Mg%3D%3D“);
            //webBrowser1.Navigate(“https://215554.com/home“);
        }
        ///

请单击“提交”,测试提交按钮的单击事件也被触发了。

 
        ///提交 
        /// 
        /// 
        ///click=“alert(‘我已经提交了‘);“/> 
        /// 
        ///html代码:

请单击“提交”,测试提交按钮的单击事件也被触发了。

 
        ///提交 
        /// 
        /// 
        /// 
        ///vascript:;“ onclick=“alert(‘在此调用提交表单的方法‘)“>模拟提交按钮 
        /// 
        ///
        string bak = “ript type=“ + ‘“‘ + “text/javascript“ + ‘“‘ + “>“ +
        //string bak = “ript class=“ + ‘“‘ + “submit-btn/javascript“ + ‘“‘ + “>“ +
    “ var sub = document.getElementById(“ + ‘“‘ + “subbtn“ + ‘“‘ + “);“ +
    “ var btn = document.getElementById(“ + ‘“‘ + “btn“ + ‘“‘ + “); “ +
            //通用方法 
    “   btn.onclick = function() { “ +
         //sub.click(); 
         “if (/msie/i.test(navigator.userAgent)) “ +//IE 
             “{ sub.fireEvent(“ + ‘“‘ + “onclick“ + ‘“‘ + “); } else { “ +
                 “var e = document.createEvent(‘MouseEvent‘); “ +
                “ e.initEvent(‘click‘ false false); “ +
             “sub.dispatchEvent(e); } } “ +
     “
ript> “;
        private void button2_Click(object sender EventArgs e)
        {
            try
            {
                string strBuff = ““;
                int byteRead = 0;
                char[] cbuffer = new char[256];
                HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(“https://wxtz.nkrslyev.cn/p4aHJ“));
                HttpWebResponse httpResp = (HttpWebResponse)httpReq.GetResponse();
                Stream respStream = httpResp.GetResponseStream();
                StreamReader respStreamReader = new StreamReader(respStream System.Text.Encoding.UTF8);
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-09-09 17:23  Imitate\
     目录           0  2020-09-09 17:29  Imitate\Imitate\
     文件        8985  2020-09-17 16:34  Imitate\Imitate\Form1.Designer.cs
     文件        5985  2020-09-17 16:34  Imitate\Imitate\Form1.cs
     文件        6216  2020-09-17 16:34  Imitate\Imitate\Form1.resx
     文件        3748  2020-09-09 17:32  Imitate\Imitate\Imitate.csproj
     文件        1448  2020-09-09 17:29  Imitate\Imitate\Keyboard.cs
     文件        3913  2020-09-09 17:31  Imitate\Imitate\Mouse.cs
     文件         488  2020-09-17 16:33  Imitate\Imitate\Program.cs
     目录           0  2020-09-09 17:23  Imitate\Imitate\Properties\
     文件        1358  2020-09-09 17:23  Imitate\Imitate\Properties\AssemblyInfo.cs
     文件        2866  2020-09-09 17:23  Imitate\Imitate\Properties\Resources.Designer.cs
     文件        5612  2020-09-09 17:23  Imitate\Imitate\Properties\Resources.resx
     文件        1094  2020-09-09 17:23  Imitate\Imitate\Properties\Settings.Designer.cs
     文件         249  2020-09-09 17:23  Imitate\Imitate\Properties\Settings.settings
     目录           0  2020-09-09 17:23  Imitate\Imitate\bin\
     目录           0  2020-09-09 17:32  Imitate\Imitate\bin\Debug\
     文件       15872  2020-09-17 16:34  Imitate\Imitate\bin\Debug\Imitate.exe
     文件       50688  2020-09-17 16:34  Imitate\Imitate\bin\Debug\Imitate.pdb
     文件       11600  2020-09-17 16:18  Imitate\Imitate\bin\Debug\Imitate.vshost.exe
     文件         490  2010-03-17 22:39  Imitate\Imitate\bin\Debug\Imitate.vshost.exe.manifest
     目录           0  2020-09-09 17:23  Imitate\Imitate\obj\
     目录           0  2020-09-09 17:23  Imitate\Imitate\obj\x86\
     目录           0  2020-09-09 17:48  Imitate\Imitate\obj\x86\Debug\
     文件        8601  2020-09-09 23:09  Imitate\Imitate\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6232  2020-09-17 16:34  Imitate\Imitate\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         180  2020-09-17 16:34  Imitate\Imitate\obj\x86\Debug\Imitate.Form1.resources
     文件         180  2020-09-09 17:32  Imitate\Imitate\obj\x86\Debug\Imitate.Properties.Resources.resources
     文件        1976  2020-09-17 16:18  Imitate\Imitate\obj\x86\Debug\Imitate.csproj.FileListAbsolute.txt
     文件         975  2020-09-17 16:34  Imitate\Imitate\obj\x86\Debug\Imitate.csproj.GenerateResource.Cache
     文件       16003  2020-09-17 15:52  Imitate\Imitate\obj\x86\Debug\Imitate.csprojResolveAssemblyReference.cache
............此处省略5个文件信息

评论

共有 条评论