Results 1 to 6 of 6

Thread: how to connect vb with unix

  1. #1
    Join Date
    Dec 2010
    Posts
    87

    how to connect vb with unix

    Is there any way to connect vb with unix. If yes, than please tell me how?. I want to use vb in my unix operating system. I had ask this question to many people, but I don’t get satisfied with any answer. I want to use this in my college project, I’m using vb language because it is very easy to understand, but I want to run this project on unix system only, so please tell me how should I do this. Please give me some tips.

  2. #2
    Join Date
    Nov 2009
    Posts
    687

    Re: how to connect vb with unix

    Yes, that can be done you should use the winstock control which helps you to connect to the unix port and talk to unix system.
    you have to follow the following steps:
    1. first connect to unix server by typing wistock1.connect.
    2. then specify the protocol either tcp/ip e.t.c.
    3. then use winstock1.senddata to send the unix command and if taht command returns some value that can be captured by winstock1.getdata command.
    Try to follow these steps, hope this help you.

  3. #3
    Join Date
    Nov 2009
    Posts
    758

    Re: how to connect vb with unix

    Yes, it’s possible you can do that by including a winsock control (winsock1) in your form. If you want to do that just write following code:
    private sub Button1_click()
    winsock1.connect "myUnixMachine",23
    end sub
    private sub winsock1_connect()
    debug.print "connect to unix system"
    '/* now I try a logon
    winsock.senddata "myuser" & vbcrlf
    winsock.senddata "mypwd" & vbcrlf
    end sub
    private sub winsock1_dataarrival(byval bytes as long)
    dim Unixdata as string
    winsock1.getdata unixstring
    debug.print unixstring
    end sub
    private sun winsock1_close()
    debug.print "Connection close."
    end sub
    private sun winsock1_error(...)
    debuug.print "error."
    end sub
    private button2_click()
    '/* use to send command to remote machine
    winsock1.senddata text1.text & vbcrlf
    end sub
    private button3_click()
    '/* use to close connection
    if winsock1.state <> sckclosed then winsock1.close
    'or -> winsock1.senddata "quit" & vbcrlf
    end sub
    include this code in your form and you will surely connect to unix.

  4. #4
    Join Date
    Apr 2009
    Posts
    970

    Re: how to connect vb with unix

    It is possible to run vb on unix, you can use unix command using socket or you can use the winstock control which helps you to connect to the unix port. If you use unix command using socket than you have to logon, you can use:
    echo "my data string" >> myfile

    ..so you can store your data in "myfile" on unix ....
    you can look on MSDN... there is a good sample of client-server.

  5. #5
    Join Date
    May 2008
    Posts
    681

    Re: how to connect vb with unix

    Try to import following code in your form:
    Private Sub winsock1_connect()
    dim strConnected as string
    on error goto errtrap
    strConnected = "Connected"
    Debug.Print "connect to unix server system"
    Winsock1.SendData "myuser" & vbCrLf
    Winsock1.SendData " mypass" & vbCrLf
    txt1.text = strconnected
    Winsock1.SendData "cat testing" & vbCrLf 'i want to view the content of file ( unix command)
    shpWait.Visible = True
    shpGo.Visible = False
    exit sub
    ErrTrap:
    msgbox "Error Number " & err.number & vbcrlf & _
    "Error Description " & err.description
    err.clear
    End Sub
    In your 'dataArrival' sub, you need to get the size of the bytes, then convert the buffer to a string. If you don’t satisfy with this you can search on internet for more better solution

  6. #6
    Join Date
    Nov 2009
    Posts
    865

    Re: how to connect vb with unix

    You can run vb on unix. To run commands
    on a remote Unix Server.there is a component to do this operation.
    It is an OCX that has following properties:
    Login = <myLogin>
    Password = <myPassword>
    Hostname = <serverUnix>
    Protocol = SSH1
    Command = "ls -laF"
    it has the method
    Connect()

    that provide to establish a connection to the remote Unix Server and
    execute the command specified or you may search on internet on this topic for better solution.

Similar Threads

  1. How to use UUCP in UNIX
    By Sharanya in forum Operating Systems
    Replies: 5
    Last Post: 20-03-2010, 12:07 AM
  2. How do I Backup in Unix?
    By robin45 in forum Operating Systems
    Replies: 3
    Last Post: 26-08-2009, 04:56 AM
  3. To run Linux AIM in Unix ?
    By Ebenezer in forum Operating Systems
    Replies: 3
    Last Post: 19-03-2009, 02:55 PM
  4. Unix command rm -rf
    By RIMON in forum Software Development
    Replies: 1
    Last Post: 18-03-2009, 09:46 AM
  5. Learn UNIX!
    By rupak in forum Ebooks
    Replies: 4
    Last Post: 14-08-2008, 02:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,177,281.77876 seconds with 17 queries