我说选把打开多个图片路径加载到一个listbox里,利用listbox写代码
勐海ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:13518219792(备注:SSL证书合作)期待与您的合作!
Private Sub picbox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If ListBox1.SelectedIndex = count Then
Try
ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
Catch
ListBox1.SelectedIndex = 0
End Try
End If
picbox.Image = ListBox1.SelectedItem.ToString
End Sub
System.Diagnostics.Process.Start("")
或者用 WebBrowser控件,代码 WebBrowser1.Url = New System.Uri("")
Dim url As String=" 网址"
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就是网页源代码
使用webbrowser控件来加载网页,然后再
Private
Sub
WebBrowser
1_DocumentCompleted下通过使用WebBrowser1.Document.Body.
InnerHtml
来获取网页的源代码,或使用
WebBrowser1.Document.Body.InnerText来获取网页中的文本。之后可以通过字符串控制指令或者
正则表达式
来精确获取到你所需的数据。
窗体上放一个PictureBox,两个CommandButton,一个FileListBox
Private Sub Command1_Click()
If File1.ListIndex = 0 Then
ShowPic File1.ListCount - 1
Else
ShowPic File1.ListIndex - 1
End If
End Sub
Private Sub Command2_Click()
If File1.ListIndex = File1.ListCount - 1 Then
ShowPic 0
Else
ShowPic File1.ListIndex + 1
End If
End Sub
Private Sub Form_Load()
File1.Visible = False
File1.Pattern = "*.jpg;*.gif" '可以浏览的文件类型,使用分号隔开
File1.Path = App.Path '改成你需要浏览的目录,比如"C:\Pic"
If File1.ListCount 1 Then '目录中图片在两张以上可以浏览
ShowPic 0
Exit Sub
ElseIf File1.ListCount = 1 Then '目录中只有一张图片时只显示这一张
ShowPic 0
End If
Command1.Enabled = False
Command2.Enabled = False
End Sub
Private Sub ShowPic(Index As Long)
File1.ListIndex = Index
Picture1.Picture = LoadPicture(File1.Path "\" File1.List(Index))
End Sub
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
vaela