Results 1 to 4 of 4

Thread: String in code!

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    5

    String in code!

    Hey, im trying to store a string inside a code.

    I know it's possible in php but can anyone help me.
    This is what i'm trying to do:

    Code:
    Dim storedurl As String
    storedurl = "http://www.site.com/photoalbum/photos/"
    
    WebBrowser1.Navigate(""storedurl""images.jpg")
    As you can see, im just trying to use storedurl to define as a sting and use it so i can declare the storedurl once and i can make my simple online photobook.

    And so i dont need to put site.co/photo.... ect always there!
    Can anyone help me?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: String in code!

    vb Code:
    1. Dim storedurl As String
    2. storedurl = "http://www.site.com/photoalbum/photos/"
    3. WebBrowser1.Navigate(storedurl & "images.jpg")

    edited

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    5

    Re: String in code!

    Quote Originally Posted by .paul.
    vb Code:
    1. Dim storedurl As String
    2. storedurl = "http://www.site.com/photoalbum/photos/"
    3. WebBrowser1.Navigate(storedurl & "images.jpg")

    edited
    Thanks!!

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: String in code!

    you can declare storedurl at form level, then it'll be available in any sub or function in that form.

    vb Code:
    1. Public Class Form1
    2.  
    3.     Dim storedurl As String = "http://www.site.com/photoalbum/photos/"
    4.  
    5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    6.  
    7.     End Sub
    8.  
    9. End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width