189 8069 5689

vb.net相册源代码 代码相册源代码

如何用vb.net获得网页的源代码

Dim url As String=" 网址"

创新互联公司是专业的丘北网站建设公司,丘北接单;提供成都做网站、成都网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行丘北网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

Dim httpReq As System.Net.HttpWebRequest

Dim httpResp As System.Net.HttpWebResponse

Dim httpURL As New System.Uri(url)

httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)

httpReq.Method = "GET"

httpResp = CType(httpReq.GetResponse(), HttpWebResponse)

httpReq.KeepAlive = False ' 获取或设置一个值,该值指示是否与

Internet资源建立持久连接。

Dim reader As StreamReader = _

New StreamReader(httpResp.GetResponseStream,

System.Text.Encoding.GetEncoding(-0))

Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码

怎样用VB编程弄一个相册?

首先把那些人的相片都放到一个文件夹里 (比如D:\PHTO 文件夹里,并且名字命名为 相片主人的名字;名字+1;名字+2......)

新建一个工程, 添加 TEXT1.TEXT , 按钮 , IMAGE 控件.

按钮的单击代码,我只说大概:

IF TEXT1.TEXT = "自己的照片" THEN

image.picture=loadpicture("d:\photo\" + TEXT1.TEXT + ".JPG")

然后在添加个按钮, 名字为: 下一张

单击代码: image.picture=loadpicture("d:\photo\自己的照片" + "1" + ".JPG")

BitBlt

StretchBlt

用VB.NET制作相册

假设有三张图片在资源里,VB.NET不允许资源的名字是纯数字,假设取名Image1,Image2......

Dim Images() As System.Drawing.Bitmap = {My.Resources.Image1, My.Resources.Image2, My.Resources.Image3}

Dim CurrentImage As Integer

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click

If CurrentImage 2 Then CurrentImage += 1 Else CurrentImage = 0

PictureBox1.Image = Images(CurrentImage)

End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

If CurrentImage 0 Then CurrentImage -= 1 Else CurrentImage = 2

PictureBox1.Image = Images(CurrentImage)

End Sub


文章名称:vb.net相册源代码 代码相册源代码
文章分享:http://jkwzsj.com/article/docpihe.html

其他资讯