I
inhahe
I have the following code
---
using System;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class cl {
static public void Main() {
byte[] byteReadStream = null;
IPEndPoint ipe = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 213);
TcpListener tcpl = new TcpListener(ipe);
while(true) {
tcpl.Start();
TcpClient tcpc = tcpl.AcceptTcpClient();
byteReadStream = new byte[tcpc.Available];
tcpc.GetStream().Read(byteReadStream, 0, tcpc.Available);
MessageBox.Show (Encoding.Default.GetString(byteReadStream)); } } }
---
you send it a line on port 213 and it pops up a window showing the
message.
the problem is the message comes up behind other windows. since
MessagBox.Show() is a static method and i don't know how to get an
object for it i can't do .Focus() on it.
i thought of doing .Focus() on the whole app too but i dunno how do to
do that either.
---
using System;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class cl {
static public void Main() {
byte[] byteReadStream = null;
IPEndPoint ipe = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 213);
TcpListener tcpl = new TcpListener(ipe);
while(true) {
tcpl.Start();
TcpClient tcpc = tcpl.AcceptTcpClient();
byteReadStream = new byte[tcpc.Available];
tcpc.GetStream().Read(byteReadStream, 0, tcpc.Available);
MessageBox.Show (Encoding.Default.GetString(byteReadStream)); } } }
---
you send it a line on port 213 and it pops up a window showing the
message.
the problem is the message comes up behind other windows. since
MessagBox.Show() is a static method and i don't know how to get an
object for it i can't do .Focus() on it.
i thought of doing .Focus() on the whole app too but i dunno how do to
do that either.