Jump to content

Recommended Posts

Posted
  Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtUrl.Leave

        If txtUrl.Text.Length < 1 Then

            txtUrl.Text = "http://www.macoratti.net"
        End If

        webb1.Url = New System.Uri(txtUrl.Text)

    End Sub

pessoal  estou a ter um erro no uri, tenho alguma coisa mal?:S

Posted

Mas tu no exemplo acima tens o protocolo, logo como é que te dá o erro na mesma?

segundo a condição:

If txtUrl.Text.Length < 1 Then

            txtUrl.Text = "http://www.macoratti.net"

        End If

        webb1.Url = New System.Uri(txtUrl.Text)

se não tiver nada escrito ele escreve-me esse site mas se escrever outro site tem de ser com o protocolo http senao, nao funciona..

Posted

segundo a condição:

se não tiver nada escrito ele escreve-me esse site mas se escrever outro site tem de ser com o protocolo http senao, nao funciona..

Podes sempre um teste senao tiver o http:// ele adiciona sozinho

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.