Ip Camera

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<table width="936" height="44
<tbody>
<tr>
<td>
<span><br/>
<a title="share link to this question on Twitter
</td>
<td>


I have a PittaSoft Ip camera and I want to stream it in to my c# program, but when I run the program I got "Parameter is not valid." error

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; string sourceURL = <span style="color:#A31515; "http://192.168.1.220";
<span style="color:Blue; byte[] buffer = <span style="color:Blue; new <span style="color:Blue; byte[10000];
<span style="color:Blue; int read, total = 0;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
req.Credentials = <span style="color:Blue; new NetworkCredential(<span style="color:#A31515; "admin", <span style="color:#A31515; "admin");
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
<span style="color:Blue; while ((read = stream.Read(buffer, total, 1000)) != 0)
{
total += read;
}
Bitmap bmp = (Bitmap)Bitmap.FromStream(
<span style="color:Blue; new MemoryStream(buffer, 0, total));
pictureBox1.Image = bmp;
[/code]
<br/>
What can I do to solve the problem?



</td>
</tr>
</tbody>
</table>

View the full article
 
Back
Top