获取远程网页html源码
''' <summary>
''' 获取网页html源码。
''' </summary>
''' <param name="AUrl"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function GetHtml(ByVal AUrl As String, ByVal APageCode As System.Text.Encoding) As String
Dim httpReq As System.Net.HttpWebRequest = Nothing
Dim httpResp As System.Net.HttpWebResponse = Nothing
Dim httpURL As New System.Uri(AUrl)
Dim reader As IO.StreamReader = Nothing
Dim htmlStr As String = String.Empty
Try
httpReq = CType(Net.WebRequest.Create(httpURL), Net.HttpWebRequest)
httpReq.Method = "GET"
httpResp = CType(httpReq.GetResponse(), Net.HttpWebResponse)
reader = New IO.StreamReader(httpResp.GetResponseStream, APageCode)
htmlStr = reader.ReadToEnd()
Catch ex As Exception
Finally
If Not IsNothing(reader) Then reader.Close()
If Not IsNothing(httpResp) Then httpResp.Close()
End Try
Return htmlStr
End Function
相关文档:
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
string ......
凸线边框(宽度10,红色)
分组框 代码
<fieldset style="border:10px ridge #FF0000; padding:2px; width:500">
<legend>分组框</legend>
</fieldset>
凹线
分组框 代码
<fieldset style="border:10px groove #FF0000; padding:2px; width:500">
<legend>分组框</legen ......
/* 1 construct html form 2 bind data to form 3 validate form data 4 collect data from form */ (function($){ var controlTypes = ['textbox','password',' ......
很多时候,我们需要将下拉框里面的数据用树显示出来,这样会便于客户得到清晰的数据,而且比较直接,晾出以下HTML代码,可以直接复制到HTML代码里面运行!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tran ......