WebClient和WebRequest获取html代码
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>得到网页源代码</title>
</head>
<body MS_POSITIONING="GridLayout">
<form id="aspNetBuffer" method="post" runat="server">
<div align="center" style="FONT-WEIGHT: bold">得到任意网页源代码</div>
<asp:TextBox id="UrlText" runat="server" Width="400px">http://dotnet.aspx.cc/content.aspx
</asp:TextBox>
<asp:Button id="WebClientButton" Runat="server" Text="用WebClient得到" OnClick="WebClientButton_Click"></asp:Button>
<asp:Button id="WebRequestButton" runat="server" Text="用WebRequest得到" OnClick="WebRequestButton_Click"></asp:Button>
<asp:TextBox id="ContentHtml" runat="server" Width="100%" Height="360px" TextMode="MultiLine">
</asp:TextBox>
</form>
</body>
</html>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
private string PageUrl = "";
protected void Page_Load(object sender, EventArgs e)
{
}
相关文档:
Teach Yourself Visually Html And CSS
Pro CSS and HTML Design Patterns
JavaScript and DHTML Cookbook 2nd Edition
The Right Way Using HTML & CSS
网页制作完全手册
HeadFirst HTM ......
IF OBJECT_ID(N'dbo.p_ExportHtml') IS NOT NULL
DROP PROC dbo.p_ExportHtml;
GO
/*-- == 导出表/视图中的数据为html 文件======================
此存储过程用于将指定的表/视图中的数据导出为 html 文件
由于是使用存储过程, 因此文件目录基于 sql server 服务器
存储过程中会使用xp_cmdshell ......
一个简单的下拉菜单,主要说明CSS中posistion的作用。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"& ......
纯css:
1 .在 table 的 css 中声明: border-collapse: collapse; border-spacing: 0;
2 .th td 的css 中声明: padding:0;
半纯css:
1.上同.
2.<table cell-padding="0" .............
详细见:
http://www.dreamdu.com/xhtml/attribute_cellpadding_cellspacing/
http://www.haoxiai.net/wangzhanzhizu ......
<html>
<head>
<title>实现字体阴影 </title>
</head>
<body>
<div STYLE="position:relative; width=480; &nb ......