• 大小: 0.15M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-29
  • 语言: C#
  • 标签: c#  winform  winform  FORM  ORM  打开  

资源简介

c# winform 打开网页

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace openurl
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            //System.Diagnostics.Process.Start(“http://www.qq.com“);

            //连接
            string url = “http://www.qq.com“;
            //定义脚本
            string script = @“ript language=‘javascript‘ type=‘text/javascript‘>
                                   function openUrl(url){
                                   window.open(url‘测试窗口‘‘width=400pxheight=400pxdirectories=truelocation=falsemenubar=falseresizeable=falsescrollbars=yestoolbar=false ‘);
                                   }
ript>“;
            WebBrowser wb = new WebBrowser();
            wb.DocumentText = @“ “ + script + ““;//定义WebBrowser中的DOM文档
            wb.DocumentCompleted += delegate
            {
                //执行脚本函数
                wb.Document.Invokescript(“openUrl“ new object[] { url });
            };

        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     27136  2020-08-26 09:40  openurl\.vs\openurl\v15\.suo

     文件          0  2020-08-26 09:28  openurl\.vs\openurl\v15\Server\sqlite3\db.lock

     文件       4096  2020-08-26 09:28  openurl\.vs\openurl\v15\Server\sqlite3\storage.ide

     文件      32768  2020-08-26 09:28  openurl\.vs\openurl\v15\Server\sqlite3\storage.ide-shm

     文件     819912  2020-08-26 09:31  openurl\.vs\openurl\v15\Server\sqlite3\storage.ide-wal

     文件       9216  2020-08-26 09:31  openurl\openurl\bin\Debug\openurl.exe

     文件      28160  2020-08-26 09:31  openurl\openurl\bin\Debug\openurl.pdb

     文件       1359  2020-08-26 09:40  openurl\openurl\Form1.cs

     文件       2172  2020-08-26 09:29  openurl\openurl\Form1.Designer.cs

     文件       5817  2020-08-26 09:29  openurl\openurl\Form1.resx

     文件        827  2020-08-26 09:28  openurl\openurl\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6857  2020-08-26 09:28  openurl\openurl\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件         42  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.csproj.CoreCompileInputs.cache

     文件        703  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.csproj.FileListAbsolute.txt

     文件       1012  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.csproj.GenerateResource.cache

     文件       2209  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.csprojAssemblyReference.cache

     文件       9216  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.exe

     文件        180  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.Form1.resources

     文件      28160  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.pdb

     文件        180  2020-08-26 09:31  openurl\openurl\obj\Debug\openurl.Properties.Resources.resources

     文件       3418  2020-08-26 09:30  openurl\openurl\openurl.csproj

     文件        488  2020-08-26 09:28  openurl\openurl\Program.cs

     文件       1312  2020-08-26 09:28  openurl\openurl\Properties\AssemblyInfo.cs

     文件       2827  2020-08-26 09:28  openurl\openurl\Properties\Resources.Designer.cs

     文件       5612  2020-08-26 09:28  openurl\openurl\Properties\Resources.resx

     文件       1094  2020-08-26 09:28  openurl\openurl\Properties\Settings.Designer.cs

     文件        249  2020-08-26 09:28  openurl\openurl\Properties\Settings.settings

     文件       1120  2020-08-26 09:28  openurl\openurl.sln

     目录          0  2020-08-26 09:28  openurl\.vs\openurl\v15\Server\sqlite3

     目录          0  2020-08-26 09:28  openurl\.vs\openurl\v15\Server

............此处省略14个文件信息

评论

共有 条评论