Results 1 to 2 of 2

Thread: t

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    t

    Is there a site that converts vb6 code to either vb.net or c#?
    Thanks

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    you should be able to re-write alot of vb6 stuff to vb.net without to much trouble , at first when i got in to .net i couldnt seem to stick with it, but now i only open vb6 to make code examples for people requiring help. is it a particular piece of code or just general stuff?
    as for C# , thats quite a lot like java / c++ ( with .net mixed in also )
    for example , in vb6 to split up some text , with a space as the delimiter you could do this :
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim x As Integer
    3.  
    4. Dim strString As String, strResult() As String
    5.  
    6. strString = "some text"
    7.  
    8. strResult = Split(strString, " ")
    9.  
    10. For x = LBound(strResult) To UBound(strResult)
    11.     MsgBox strResult(x)
    12. Next
    13.  
    14. End Sub

    in vb.net it's much simpler :
    VB Code:
    1. Dim x As Int32
    2.             Dim strResult() As String = "some text".Split(" ")
    3.             For x = strResult.GetLowerBound(x) To strResult.GetUpperBound(x)
    4.                 MsgBox(strResult(x))
    5.             Next
    in C# you could do this :
    VB Code:
    1. string[] str="some text".Split(' ');
    2. for (int x=0;x!=str.Length;x++)
    3. {
    4. MessageBox.Show(str[x]);
    5. }

    in java you could do this :
    VB Code:
    1. <script language="javascript">
    2.  
    3. var str= "some text".split(" ");
    4.  
    5. for (int=0;int!=str.length;int+=1)
    6. {
    7.     window.alert(str[int]);
    8. }
    9. </script>
    some useless info for you there
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

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