Public Class frmSource Private Sub btnViewSource_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewSource.Click btnViewSource.Enabled = False Dim WebStream As System.Net.WebClient Dim SourceCodeStream As System.IO.Stream WebStream = New System.Net.WebClient Try SourceCodeStream = WebStream.OpenRead(txtURL.Text) Dim objReader As System.IO.StreamReader = New System.IO.StreamReader(SourceCodeStream) txtSource.Text = objReader.ReadToEnd Catch MsgBox("Invalid URL" & vbCrLf & "The file you are looking for cannot be found.", MsgBoxStyle.Exclamation, "Invalid URL") End Try btnViewSource.Enabled = True End Sub Private Sub frmSource_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.txtURL.Text = Form1.ComboBox1.Text End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question