|
How to connect hardware device to my C# program , such as Camera , or any device (connect by port)
CS
|
|
|
|
|
About the only answer anyone can give you, because there is no detail in the question, is that you would normally talk to the device using it's device driver.
There is no one method for any and all devices. Each device has it's own rules and methods for communicating with it.
|
|
|
|
|
i like to connect a camera with my C# program , how can i do it
im begginer in C#
thanks for u
CS
|
|
|
|
|
If you have a driver, the camera probably appears as a removable USB drive. You can find lots of information about how to detect and access one of them if you Google it.[^]
If you don't have a driver one will need to be written first. You cannot do this in C#, it must be done in C/C++. Writing a driver is *not* an easy task, nor is it something that can be done by a beginning level programmer.
--
Help Stamp Out and Abolish Redundancy
The preceding is courtesy of the Department of Unnecessarily Redundant Repetition Department.
|
|
|
|
|
Do you want to be more specific about what exactly you're doing with the camera?? What kind of camera?? Is it attached USB?? Do you have drivers?? Are you trying to get a "live" image from the camera?? Are you just downloading images stored in the camera?? Does it show up as a "USB Storage Device" in Explorer??
Or should we just leave it at the less-than-meager explanation you've given and drop the whole idea?? I repeat - The quality (read: detail) of the question you ask is DIRECTLY responsible for the quality of the answer you get.
|
|
|
|
|
I am writeing windows service that makes use in MSMQ in .net 2003 in c#.
I user the method beginPeek(TimeSpan) and waiting for an message to arrive
the event handler look like this:
private void MyPeekCompleted(Object source,
PeekCompletedEventArgs asyncResult)
{
try
{
// End the asynchronous peek operation.
Message m = _mq.EndPeek(asyncResult.AsyncResult);
//logic to handel message
mq.BeginPeek(new TimeSpan(0,1,0));
}
catch(MessageQueueException e)
{
if (e.MessageQueueErrorCode ==
MessageQueueErrorCode.IOTimeout)
{
Console.WriteLine(e.ToString());
}
_mq.BeginPeek(new TimeSpan(0,1,0));
}
catch(Exception ex)
{
// some code to handel error
}
after a while i get stackoverflow exception. event though no message arrives...
It works fike for a couple of minuts and than crushes..
How can i solve this..
Sample code will be greate help..
im using winXP
Thnks
|
|
|
|
|
Hi,
I have no experience in this, but I see a logical problem in your code.
the MSDN example has BeginPeek as the last statement in the PeekCompleted handler.
Yours has more than one BeginPeek, and they are not at the end, so if they complete
before you have left the Completed handler (Console.WriteLine will take some msecs),
a new one would be launched before the current one exits, consuming stack space.
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yhanks for the
I dont understnd what you mean
can you pleas wexplain again
|
|
|
|
|
Mire over i have 2 begin peek because i have to continue waiting for a message
one begin peek is in call if no exception and the other if an exception happen so
they will never happen at the same time
|
|
|
|
|
Hi,
this is my suggestion: remove the BeginPeeks you have, and put a single
mq.BeginPeek(new TimeSpan(0,1,0));
as the very last line of the PeekCompleted handler.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I am writeing windows service that makes use of MSMQ in .net 2003 in c#.
I use the method beginPeek(TimeSpan) and wating for an message to arrive
the event handler look like this:
private void MyPeekCompleted(Object source,
PeekCompletedEventArgs asyncResult)
{
try
{
// End the asynchronous peek operation.
Message m = _mq.EndPeek(asyncResult.AsyncResult);
//logic to handel message
mq.BeginPeek(new TimeSpan(0,1,0));
}
catch(MessageQueueException e)
{
if (e.MessageQueueErrorCode ==
MessageQueueErrorCode.IOTimeout)
{
Console.WriteLine(e.ToString());
}
_mq.BeginPeek(new TimeSpan(0,1,0));
}
catch(Exception ex)
{
// some code to handel error
}
after a while i get stackoverflow exception. event though no messages arrives...
It works fike for a couple of minuts and than crushes..
How can i solve this..
Sample code will be greate help..
im using winXP
Thnks
|
|
|
|
|
I have a Web Page. aspx. It's accessable via a navigation button at the top. This loads the page.
It will be used as an Admin page for the Web App. to allow administrators to Add/Update drop down list items for the rest of the application.
On loading it has
DropDownList TextBox Add(button) Update(button)
DropDownList TextBox Add(button) Update(button)
DropDownList TextBox Add(button) Update(button)
DropDownList TextBox Add(button) Update(button)
DropDownList TextBox Add(button) Update(button)
etc...........
how do I clear the text boxes without installing a reset button? I may as well click the navigation again, although I know that, the Administator doesn't. Can I clear all the fields in one go or is it txtBoxName.Text = "" for each field. Is there a 'global page' command?
|
|
|
|
|
Don't repost the same question.
|
|
|
|
|
Don't bother posting ...unless you have an answer.
|
|
|
|
|
imnotso# wrote: Can I clear all the fields in one go
No.
imnotso# wrote: or is it txtBoxName.Text = "" for each field
Yep. Controls do not remember their initial state.
imnotso# wrote: Is there a 'global page' command
Nope.
|
|
|
|
|
Thanks Dave,
I'll get typing !
|
|
|
|
|
You could either do it the long way, or you can write a method to enumerate the controls on the form, looking for textbox's, and set the Text property of each one it finds.
|
|
|
|
|
I will, findcontrol isn't it, I presume I can use indexof.
Good thinking Dave, Thanks.
|
|
|
|
|
hi, i am sending Bulk mails to users by getting mailid's from text file.
For every 1 sec 1 mail is going.(i.e for 1000 mails it takes 16 min time)
But i need to sent 1000 mails in 2 min(It is possible)
But i dont know the method how to send this.
plz give suggestion reg this..
can any one has idea reg this. How can put the mails in Queue?????
G.Satish
G. Satish
|
|
|
|
|
It depends whether you're using an SMTP server or working directly with the SMTP protocol. Exactly who are the lucky recipients of your bulk mailshot?
Regards,
Rob Philpott.
|
|
|
|
|
Please do not repost your message. Its just rude. Especially when your first message is still on the first page, and was only posted less than 4 hours ago.
Some other points:
'plz' is not a word, its actually 'Please'. I know, shocking.
Adding extra question marks doesn't help.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
i create dataset by wizard and i need to get connection
123
|
|
|
|
|
Good for you.
Regards,
Rob Philpott.
|
|
|
|
|
Use magic.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
The quality of the question you ask directly reflects on the quality of answers you get. Since you provided just about no information about what you waht to do or what you've done, there is little to nothing anyone can tell you to answer your "question".
|
|
|
|