3 Star 17 Fork 8

独立观察员/Practice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FormBrowserJs.cs 723 Bytes
一键复制 编辑 原始数据 按行查看 历史
独立观察员 提交于 6年前 . ss
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace WinFormPractice
{
[ComVisible(true)]
public partial class FormBrowserJs : Form
{
public FormBrowserJs()
{
InitializeComponent();
webBrowser.Navigate(Path.Combine(Application.StartupPath, "HTMLBrowserJs.html"));
webBrowser.ObjectForScripting = this;
}
public void ShowMsgForJs(string msg)
{
TBRecv.Text += $"{msg}\r\n";
}
private void BtnSend_Click(object sender, EventArgs e)
{
webBrowser.Document.InvokeScript("ShowMsgForCSharp", new []{ TBSend.Text });
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dlgcy/Practice.git
git@gitee.com:dlgcy/Practice.git
dlgcy
Practice
Practice
master

搜索帮助