I am trying to display a video from my ip camera on a panel. I have used an "http request" to get the video from the camera and i got a problem with displaying the video on the panel, so i need a help please?
am using c#, on visual studio 2010, windows form application...
I was trying to access my IP camera and used the following code
string sourceURL = "ipaddress";
byte buffer = new byte;
int read, total = 0;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
req.Credentials = new NetworkCredential("username","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 when i compiled the code, the following message will be displayed what can I do to solve this?
"Grab Error: System.Net.WebException:The remote server returned an error:(400)Bad request. at System.Net.HttpWebRequest.GetResponse()"
Due to the above, I have the following questions:
1. if I want to change the statement to select either "*bErrorReport.xlsx" or "*dErrorReport.xlsx" or "*ErrorReport.xlsx",
how would I change the statement I just displayed?
2. The above statement picks 3 excel spreadsheets and there are really only two excel spreadsheets. The excelspreadshets that are valid
The invalid value that is selected is
Can you show me the code, so an invalid spreadsheet called ~customer_number_bErrorReport.xlsx is not selected?
You should've told me about this earlier.
I'm a programmer in this company and nothing much to do.
I won't and not going to do something useless for them if they didn't ask.
This application is what they want, not me.
I'm angry because I can't fullfill what they want.
Sorry for misunderstanding.
Oh ya, I didn't log their key, I only count how many times they typed.
Who ask you about difference between working and screwing around?
I only want to know how to hook keyboard press in a windows form even after it's minimized or not focused.
Look, I managed to solve my own problem.
I ask here nicely to get some help so I can finish this faster.
This is what I called (solution) even it's not what I want, I appreciate it.
Abhinav S wrote:
Handling the forms keydown event would give you a count of key strokes within the application.
Dave, I believe you know how to do this.
But I don't know why everytime you respond my question, always something weird like your question above.
I tried to learn, not "gimme code to hook keyboard press please thank you email me bla bla".
Next time if you're not going to give me some help, then please find another question to answer.
How do you define "more useful"? There are many reasons why you would choose one over the other but it will depend on the problem you are trying to solve and the skill levels and experience of your developers.
One of these days I'm going to think of a really clever signature.
You get Access Denied because the account your code is running under does not have permissions to the remote machine. By default, if you don't specify any account information in the Management connection objects, it'll use the account your code is running under. If that account doesn't have permissions on the remote machine, it'll fail.