|
-
May 22nd, 2013, 09:00 PM
#1
Thread Starter
Member
An error occurred creating the form. See Exception.InnerException for details.
Dim tags = Form2.RichTextBox1.Lines
Dim url = ???"
Dim urltags = ?? + tags
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(urltags)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
End If
___________________________________________________________________________________________
when i change
Dim tags = Form2.RichTextBox1.Lines to form2.richtextbox1.text it works but it only scans the 1st word of the list and stops
___________________________________________________________________________________________
ERROR: Operator '&' is not defined for string "https://live.xbox.com/en-GB/Prof" and type 'String()
Last edited by League; Aug 21st, 2013 at 12:25 AM.
-
May 22nd, 2013, 09:04 PM
#2
Re: An error occurred creating the form. See Exception.InnerException for details.
Code:
Dim tags as string = string.join("put the separator here", Form2.RichTextBox1.Lines)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 22nd, 2013, 10:49 PM
#3
Thread Starter
Member
Re: An error occurred creating the form. See Exception.InnerException for details.
 Originally Posted by .paul.
Code:
Dim tags as string = string.join("put the separator here", Form2.RichTextBox1.Lines)
didnt work:
Dim tags As String = String.Join("https://live.xbox.com/en-GB/Profile?gamertag=", Form2.RichTextBox1.Lines)
doesnt work with form2.richtextbox1.text either
error:
Invalid URI: The format of the URI could not be determined.
-
May 22nd, 2013, 11:11 PM
#4
Re: An error occurred creating the form. See Exception.InnerException for details.
 Originally Posted by League
didnt work:
Dim tags As String = String.Join("https://live.xbox.com/en-GB/Profile?gamertag=", Form2.RichTextBox1.Lines)
doesnt work with form2.richtextbox1.text either
error:
Invalid URI: The format of the URI could not be determined.
It didn't work because you didn't do it properly. .paul. specifically said:Is "https://live.xbox.com/en-GB/Profile?gamertag=" the value you want separating the parameters? Of course it isn't. Did you actually read the documentation for String.Join to see how it works? Of course you didn't. Did you even look to see what 'tags' contains after that code?
String.Join works by combining the list of values (the second argument) into a single String with each pair separated by the delimiter (the first argument). For instance, if you do this:
Code:
Dim values = {"First", "Second", "Third"}
Dim result = String.Join("||", values)
MessageBox.Show(result)
then you will see this:So, in your case, you need to specify the bit of text that you want to separate each pair of lines from the RichTextBox in the final result when you call String.Join, then you need to concatenate that result with your original URL.
-
May 23rd, 2013, 01:21 AM
#5
Thread Starter
Member
Re: An error occurred creating the form. See Exception.InnerException for details.
 Originally Posted by jmcilhinney
It didn't work because you didn't do it properly. .paul. specifically said:Is "https://live.xbox.com/en-GB/Profile?gamertag=" the value you want separating the parameters? Of course it isn't. Did you actually read the documentation for String.Join to see how it works? Of course you didn't. Did you even look to see what 'tags' contains after that code?
String.Join works by combining the list of values (the second argument) into a single String with each pair separated by the delimiter (the first argument). For instance, if you do this:
Code:
Dim values = {"First", "Second", "Third"}
Dim result = String.Join("||", values)
MessageBox.Show(result)
then you will see this:So, in your case, you need to specify the bit of text that you want to separate each pair of lines from the RichTextBox in the final result when you call String.Join, then you need to concatenate that result with your original URL.
didnt know what a seperator was obviously i even googled what came up was http://www.vbforums.com/showthread.p...uding-designer before posting and i googled the definition seperators also to make sure never heard of seperators in vb before now
yes i read the code lost at seperators cause ive never heard of it so i guessed and put the link
but thanks i actually get how it works
made my day too youre funny <3
-
May 23rd, 2013, 01:34 AM
#6
Re: An error occurred creating the form. See Exception.InnerException for details.
That's exactly why you should have read the documentation for the String.Join method. Surely it should be obvious that if you try to use a method and it doesn;t work, you read the instructions for that method. That documentation gives a perfectly simple example:
 Originally Posted by MSDN
For example, if separator is ", " and the elements of value are "apple", "orange", "grape", and "pear", Join(separator, value) returns "apple, orange, grape, pear".
The Help menu in your IDE is there for a reason, as is the F1 key, which is used for Help in many thousands of Windows applications. They should ALWAYS be your first choice for help on a specific topic and using a known method is about as specific as it gets.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|