locked
New To .Net Need Help ! RRS feed

  • Question

  • User-611469688 posted

    HELLO,

    so i'v been working  on converting a code from C# To Visual Basic.Net and it seems i am doing something  wrong :

            Dim Links As String() = TextBox1.Text
            For Each Link As String In Links
            Dim GETRequest As HttpWebRequest = DirectCast(WebRequest.Create(Link), HttpWebRequest)...etc (the rest of the code is all fine)

    Error 32 Value of type 'String' cannot be converted to '1-dimensional array of String'.  <--- i'm getting the following error
     

    i want the program to read links from a textbox one by one > process them > post results into new textbox then go back to reading the next link, Please Note That i'm  new to VB.NET so i dont know what should i do to fix this error :P
     

    Thursday, May 17, 2012 4:39 PM

Answers

  • User-158764254 posted

    Dim Links As String() = TextBox1.Text

    I'm wondering what your original code looks like in c# for the above line as that vb.net line is not going to work.

    Textbox1.Text is a simple string and you're trying to assign it to a string array.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 19, 2012 7:52 AM

All replies

  • User-2138542565 posted

    Make use of this link to convert your Vb.net code to C#

    Thursday, May 17, 2012 5:12 PM
  • User-611469688 posted
    i did use it , it came with the same results as above =/ btw its c# to vb that i wanna do , not vb to c# =)
    Thursday, May 17, 2012 5:31 PM
  • User-2138542565 posted

    You just have to toggle the buttons. Here i did it for you. Check this link

    Thursday, May 17, 2012 5:39 PM
  • User-158764254 posted

    Dim Links As String() = TextBox1.Text

    I'm wondering what your original code looks like in c# for the above line as that vb.net line is not going to work.

    Textbox1.Text is a simple string and you're trying to assign it to a string array.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 19, 2012 7:52 AM