Accessing of .exe file of other computer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vabh
    New Member
    • Feb 2008
    • 9

    Accessing of .exe file of other computer

    Hello,
    My computer is connected in LAN and so many other computers too. So, now i want to access any .exe file of any other computer. Before that i am accessing the Computer Name and IPAddress of other computer using following code---
    Code:
                Dim s1, s2 As String
                Dim IPHost As IPHostEntry = Dns.GetHostEntry("ASHEESH")
                'IPHost = Dns.Resolve("ASHEESH")
                s1 = IPHost.HostName.ToString
                'MsgBox(IPHost.HostName.ToString)
                Dim aliases() As String
                aliases = IPHost.Aliases
                Dim addr() As IPAddress
                addr = IPHost.AddressList
                s2 = addr(0).ToString
                'MsgBox(addr(0).ToString)
                'MsgBox(s1 & s2)
                Label2.Text = s1 & s2
                Dim ep As EndPoint = New IPEndPoint(addr(0), 80)
                Dim sock As Socket = New Socket(AddressFamily.InterNetwork, _  SocketType.Stream, ProtocolType.Tcp)
                sock.Connect(ep)
                If (sock.Connected) Then
                    Label1.Text = s1 & s2 & "Connected"
                    'MsgBox("ok")
                Else
                    Label1.Text = s1 & s2 & "Not Connected"
                End If
                'Response.Redirect_("http://192.168.42.44/localhost/printingtest/publish.htm")
                sock.Shutdown(SocketShutdown.Both)
    Can i access any .exe file using this code... because it is saying me that u are connected with other computer so because of that...........
    Please answer me as early as possible its urgency ............. really....
    Last edited by jhardman; Apr 7 '08, 07:18 PM. Reason: put code in code tags. Please note button marked - #
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    I am not familiar with the way you are accessing other PCs on a network in itself.

    However, if you can create a connection in your app to a specific directory you should be able to access any file on that PC including .exes as long as permissions are set up for it, or your code can fill in parameters to allow for access.

    Also it may help to understand more about what your end goal is. Are you wanting to launch a .exe from your forms? Or allow a download of the .exe?

    Or are you wishing your ASP pages to call the .exe to process data? If this is the case, depending on how big your process is, you can use asynchronous processing to call an exe and release the web session back to the user.
    A perfect example of this can be found here


    OR another good bet is to transform your .exe into a .dll to be called within a ASP page as an object. You would have to move the code of the .exe to a new project and export it as a dll, register it, etc then you can access in your page.

    Not sure if this is what your looking for.

    Comment

    Working...