?
Solved

What is the best way to invoke Interactive Dialogs (Popup, Messagebox, IE windows, etc) on Remote Machines on a Network in VB.NET?

Posted on 2004-09-09
8
Medium Priority
?
198 Views
Last Modified: 2010-04-23
Question is pretty self explanatory... I have always wondered what a good way to display some form of popup (preferrably as nice an interface as possible (not just a plain message box if possible) on remote machines would be.... Say for example I have a console on my machine locally, and it goes out to a number of machines, displays a popup stating "X will happen in a few minutes, please be patient...etc etc", and my process would start in "x" amount of time and go through the process and notify them again upon completion....

Anyone have any good suggestions?

Thanks

0
Comment
Question by:phesser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:prakash_prk
ID: 12023712

Run your client program in the client machine.
send request from your server program to client program 'to display message box ' after completing send a request from client to server .

0
 

Author Comment

by:phesser
ID: 12026264
Sorry prakash_prk but I need more explanation than that.... I dont know how to do client > server model programming yet... I just have one console application and want to just send a dialog popup to a remote machine and looking for the simplest way, plus some code examples.

Thanks
0
 

Author Comment

by:phesser
ID: 12060676
Still have not received a response on this... anyone have input??
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:prakash_prk
ID: 12061396
Server Program
-----------------------------
Imports System.Net.Sockets
Imports System.Text
Class TCPSrv
    Shared Sub Main()
        ' Must listen on correct port- must be same as port client wants to connect on.
        Const portNumber As Integer = 8000
        Dim tcpListener As New TcpListener(portNumber)
        tcpListener.Start()
        Console.WriteLine("Waiting for connection...")
        Try
            'Accept the pending client connection and return
            'a TcpClient initialized for communication.
            Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient()
            Console.WriteLine("Connection accepted.")
            ' Get the stream
            Dim networkStream As NetworkStream = tcpClient.GetStream()
            ' Read the stream into a byte array
            Dim bytes(tcpClient.ReceiveBufferSize) As Byte
            networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
            ' Return the data received from the client to the console.
            Dim clientdata As String = Encoding.ASCII.GetString(bytes)
            Dim totalData() As String
            Dim ds As Microsoft.VisualBasic.MsgBoxResult
            totalData = Microsoft.VisualBasic.Split(clientdata, ":")
            If totalData(0) = "ShowMessageBox" Then
                ds = Microsoft.VisualBasic.MsgBox(totalData(1))
            End If

            Dim responseString As String = "Result for MessageBox" & vbCrLf & ds.ToString
            Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(responseString)
            networkStream.Write(sendBytes, 0, sendBytes.Length)

            'Any communication with the remote client using the TcpClient can go here.
            'Close TcpListener and TcpClient.
            tcpClient.Close()
            tcpListener.Stop()
            Console.WriteLine("exit")
            Console.ReadLine()
        Catch e As Exception
            Console.WriteLine(e.ToString())
            Console.ReadLine()
        End Try
    End Sub
End Class
----------------------------------
CLient Program
-----------------------------------

Imports System.Net.Sockets
Imports System.Text
Class TCPCli
        Shared Sub Main()

            Dim tcpClient As New System.Net.Sockets.TcpClient
            tcpClient.Connect("127.0.0.1", 8000) ' This address must be the server ip address
            Dim networkStream As NetworkStream = tcpClient.GetStream()
            If networkStream.CanWrite And networkStream.CanRead Then

            ' Do a simple write.
            Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("ShowMessageBox:Message goes here")
                networkStream.Write(sendBytes, 0, sendBytes.Length)
                ' Read the NetworkStream into a byte buffer.
                Dim bytes(tcpClient.ReceiveBufferSize) As Byte
                networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
                ' Output the data received from the host to the console.
                Dim returndata As String = Encoding.ASCII.GetString(bytes)
            Console.WriteLine(("Host returned: " + returndata))

            Else
                If Not networkStream.CanRead Then
                    Console.WriteLine("cannot not write data to this stream")
                    tcpClient.Close()
                Else
                    If Not networkStream.CanWrite Then
                        Console.WriteLine("cannot read data from this stream")
                        tcpClient.Close()
                    End If
                End If
            End If
            ' pause so user can view the console output
            Console.ReadLine()
        End Sub
    End Class

----------------------

Both of them are console applications.

regards
prakash
0
 

Author Comment

by:phesser
ID: 12063962
Prakash,

Maybe I didnt explain myself clearly.  I am looking for some simple form of popup that I can 'send' from a administrator machine, to any number of remote machines 'without' there being any form of console on the target remote machines.  Basically like a remote msgbox....

Will I have to go the client / server model to accomplish this?
0
 
LVL 10

Accepted Solution

by:
prakash_prk earned 900 total points
ID: 12065023
There is a way to doing that

a command available in windows nt series machines

net send <machine name> "Message"
net send * "Message"                                 -> it send message to all the computers in the network
--------
it simple send a winpopup message to the computer specified

Try this command
 Microsoft.VisualBasic.Shell("net send * ""hai"" ", AppWinStyle.Hide, False)

regards
prakash
0
 

Author Comment

by:phesser
ID: 12067150
Thats cool I can try that, should work, but was just curious if there were any inherent classes that did the same thing in a more advanced graphical manner (add graphics, etc) ;)

I will leave this open till tommorow to see if anyone else has other input, then if a  better answer doesnt come in I will award you the points.

Thanks for all the help prakash
0
 

Author Comment

by:phesser
ID: 12089608
Didnt really get the answer I was looking for but appreciate the attempt.  Here are your points.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question