hi,
I am using MSDE as my database which is on a remote system. I have created a table in it. In my webform i have placed a crystalreportviewer control. When the page loads i need to display the crystal report in my webform. I am struggling on this issue for nearly three days.
I am using c# as my language. I need the full coding.
pls help.
Loading
cong quoc nguyenPosted Jan 8, 2006, 6:37 AM
The client program should not register this server as a computer running Kazaa, because it sends a reply. When you send a weird string to an instance of Kazaa running on port 1214, it immediately disconnects you. Hence, if you get a response, it is not Kazaa you connected to.
Here is the code I wrote for the fake Kazaa server:
FakeKazaa.cs
/////////////////////////////////////////////////////////////////////////////////////////
// A useless server to sit on port 1214 and wait for a connection, to fake the existance
// of Kazaa.
// I will attempt to make the client program realize it is fake, and not identify this
// server as Kazaa.
// Jim Peterson, 2006
/////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
public class FakeKazza
{
public static voidMain ()
{
String IP_Adress = "";
IPHostEntry localComputer = Dns.Resolve("localhost");
IPAddress[] localIP = localComputer.AddressList;
for (int i = 0; i < localIP.Length; i++) {
IP_Adress = IP_Adress + localIP[i];
}
while (true) {
try {
IPAddress ipAd = IPAddress.Parse(IP_Adress);
TcpListener listener1 = new TcpListener(ipAd, 1214);
listener1.Start();
Console.WriteLine("Fake Kazaa is running on portt 1214...");
Socket s = listener1.AcceptSocket();
Console.WriteLine("Connection accepted from this IP: " + s.RemoteEndPoint);
byte[] b = new byte[100];
int k = s.Receive(b);
Console.WriteLine("Recieved a bunch of byytes:");
for (int i = 0; i < k; i++) {
Console.Write(Convert.ToChar(b[i]));
}
ASCIIEncoding asen = new ASCIIEncoding();
// Only send these bytes if you want the scanner to identify that
// you are not Kazaa
s.Send(asen.GetBytes("OK, I recieved your bytes"));
Console.WriteLine("\nI sent the client aknowledgement");
s.Close();
listener1.Stop();
}
catch (Exception e) {
Console.WriteLine("Ah, poo, an error: " + e);
}
}
}
}
So, when we run the server, and then tell the client to scan "localhost", we should get the output:
The target is NOT running Kazaa.
Good! It works. Try commenting this line out of the server code:
s.Send(asen.GetBytes("OK, I recieved your bytes"));
And the result should be that the target is indeed running Kazaa.