Currently i'm using this
string sourceURL = "http://192.168.1.88/web/admin.html";
string login = "admin";
string password = "admin";
byte[] buffer = new byte[100000];
int read, total = 0;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
req.Credentials = new NetworkCredential(login, password);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
while ((read = stream.Read(buffer, total, 1000)) != 0)
{
total += read;
}
Bitmap bmp = (Bitmap)Bitmap.FromStream(
new MemoryStream(buffer, 0, total));
But, it's show error of "Parametor Not Valid". I tried almost each and everything, but all in vain. The, Camera i'm using is 'ZKT eco'.
I, also tried this
http:
byte[] bytes = new byte[256];
Socket sock = new Socket(AddressFamily.InterNetwork
, SocketType.Stream, ProtocolType.Tcp);
sock.Connect("192.168.1.88", 80);
if (sock.Connected)
{
int i = sock.Receive(bytes);
}
Image bmppic = ConvertByteArray2Bitmap(bytes);
pictureBox1.Image = bmppic;
But, it also showing same error.
Please help, thanks in advance...