易截截图软件、单文件、免安装、纯绿色、仅160KB

C#.net中用WinForm接收html页面消息的程序

首先写一个页面,上面要放一个Button
<html>
 <head>
  <title></title>
 </head>
 <body>
        <input id="Button1" type="button" value="button" />
 
 </body>
</html>
将其保存在HomePage.htm中,
之后我们建一个WinForm,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SXT.Frame.Ctrler.Test
{
    public partial class HtmlUi : Form
    {
        public HtmlUi()
        {
            InitializeComponent();
            this.webBrowser1.Navigate("D:\\SXT\\bin\\Debug\\HomePage.htm");//本地文件路径
        }
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {  
            HtmlDocument htmlDoc = this.webBrowser1.Document;
            HtmlElement btnElement = htmlDoc.All["Button1"];
            if (btnElement != null)
            {
                btnElement.Click += new HtmlElementEventHandler(btnElement_Click);
            }
        }
        void btnElement_Click(object sender, HtmlElementEventArgs e)
&n


相关文档:

C#导出xls,word,图片及样式问题

public void ExportControl(System.Web.UI.Control source, string DocumentType, string filename)
{
//设置Http的头信息,编码格式
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
......

C#获取当前路径的方法

//获取包含清单的已加载文件的路径或 UNC 位置。
public static string sApplicationPath = Assembly.GetExecutingAssembly ( ).Location;
//result: X:\xxx\xxx\xxx.dll (.dll文件所在的目录+.dll文件名)
//获取当前进程的完整路径,包含文件名(进程名)。
string str = this.GetType ( ).Assembly.Location;
//result ......

html總結(中)

有關html窗體框架的問題,如果想要實現在一個畫面中分割窗體,並且通過點擊其中的一個窗體,鏈接內容至同一個畫面中的另一個窗體。就需要使用<frameset>與<frame>的 ......

HTML表格专有属性和CSS


HTML表格很容易上手,一堆tr加td就可以显示一张表格了。复杂一点就是再加上th,colgroup,tbody,tfooter,caption之类。这些HTML里面的各种元素的确加强了表格的实用性和语义化,但table本身就有很大学问哦,毕竟是整个表格的根啊!
今天下面要总结包含对table本身的属性归纳和table专用的CSS比较:
attributes VS CSS ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号