|
I don't know but if you can the answer would be here http://www.usb.org/developers/docs/
File Not Found
|
|
|
|
|
AFAIK a USB can only supply a maximum of 5V anyway and I think it's fairly constant, that's why big devices such as printers have to be plugged into the mains.
|
|
|
|
|
Yeah... 5V is plenty ...however, I need to know if I can trigger the supply voltage on and off somehow. I don't need the USB to supply me with any power, but just act as a switch. I haven't had much time to research this, thanks for the replies so far.
|
|
|
|
|
I'm pretty sure that the power is supplied constantly in most cases, it'd probably be wiser to use the data line and when it's on transmit 0xff continuously and when you want off transmit 0x00.
|
|
|
|
|
Interesting. If I recall correctly the Data lines supply 3.3V when transmitting and 0 when not ? If so that's great. Now I have to find away to communicate with the USB Port itself via code. Thanks for the replies.
|
|
|
|
|
Might want to take a look at #UsbLib[^].
|
|
|
|
|
|
What is GetHashCode method for? More importantly what is HashCode and why would we need it ? Thanks in advance.
|
|
|
|
|
From MSDN[^]:
A hash function is used to quickly generate a number (hash code) that corresponds to the value of an object. Hash functions are usually specific to each Type and must use at least one of the instance fields as input. A hash function must have the following properties:
- If two objects compare as equal, the GetHashCode method for each object must return the same value. However, if two objects do not compare as equal, the GetHashCode methods for the two object do not have to return different values.
- The GetHashCode method for an object must consistently return the same hash code as long as there is no modification to the object state that determines the return value of the object's Equals method. Note that this is true only for the current execution of an application, and that a different hash code can be returned if the application is run again.
For the best performance, a hash function must generate a random distribution for all input.
/ravi
|
|
|
|
|
I know now to set a break point on my web method from VS 2005, but how do I get the web method to actually stop at that break point and when I access it?
Thanks
|
|
|
|
|
By navigating to that page. You can either run the website with F5, or you can attach the IDE debugger to the aspnet process.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hello
i want to make an ocr in the .net... but can't find a dip dll around... plz if some one knows a link forward it to me
thanx
haseeb
|
|
|
|
|
I don't think there are any OCR solutions in .NET. It's a complex problem.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm writing a class that represent one connection ( with remote host) informations.
public class ConnectionInfromation
{
public Socket socket;
public int ConnectionStatus;
}
and then creating an array from that class, so every element in the array carry an
information for one connection
private ConnectionInfromation[] ConnInformations = new ConnectionInfromation[10];
but the poblem occur's when i try to assign an instance of Socket class to socket member
in ConnectionInfromation class
ConnInformations[0].socket = server.AcceptSocket();
the exception NullReferenceException is thrown with the comment(Object reference not set to an instance of an object )
what is the solution for this, how can i assign an instance for socket member in
ConnectionInfromation class.
|
|
|
|
|
Hussam Fattahi wrote: private ConnectionInfromation[] ConnInformations = new ConnectionInfromation[10];
This creates an array, but the items in the array, are all null. You need to call new on each item to create it, as in ConnInformations[0] = new ConnectionInfromation ( that's a typo in your code, BTW )
Why not use a list ? Must you have exactly 10 ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanks alot, it works.
and for the 10, i was just testing the code.
and i was thinking about using an ArrayList.
|
|
|
|
|
If you're using C# 2005, you should never use arraylist, it's outdated crap. Use a generic List instead.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Two problems: One your class declaration for ConnectionInfromation is misspelled and contains inconsistent naming conventions. Use camelCase or PascalCase but not both.
Two declaring an array only allocates the memory. You need a for loop to assign each block in the array to a new instance of ConnectionInformation. Ala
ConnectionInformation[] connections= new ConnectionInformation[10];
for(int i=0;i<connections.Length;i++){
connections[i] = new ConnectionInformation();
}
File Not Found
|
|
|
|
|
Did you mean that i should write the declaration like:
ConnectionInformation[] Connections= new ConnectionInformation[10];
or like :
connectionInformation[] connections= new ConnectionInformation[10];
i'm new at programming, and i didn't know about naming conventions, and i just finish
reading about them in MSDN.
thanks alot.
|
|
|
|
|
I think he meant that you should use a consistent naming scheme. In the code snippet of your initial post one field started with an uppercase letter and one started with a lowercase letter. This is inconsistent. If I recall right the naming conventions given in the docs suggest that public fields start with an uppercase letter.
By the way, it is not recommendable to make fields publicly accessible as done in your initial post. Instead you should declare them as private fields and make them accessible through properties.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Class names should be in PascalCase
Member names should be in camelCase (with the additional caveat of never have public members)
Property names should be camelCasePascalCase [oops ]
Variable names should be camelCase
Parameter names should be camelCase
If you don't agree with my above guidelines that is fine so long as you are CONSISTENT. That is one of the first signs you are maturing as a developer, the ability to be consistently wrong :p
-- modified at 17:24 Tuesday 13th February, 2007
File Not Found
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Property names should be camelCase
Bzzt. Property and method names should be PascalCase if you want your code to feel familiar to any .NET developer.
|
|
|
|
|
Read my caveat. Only public members should be in PascalCase and public members should never be used. Thus members should be in camelCase since all members should be protected or private.
Sorry, your right, I made a typo and then misread your reply.
File Not Found
|
|
|
|
|
I need to know how to read computer name in C# to a label
Thanks
|
|
|
|
|
Attach the ear adapter to the label and then speak slowly into your microphone.
Sorry, couldn't resist. How bout some code as an apology
myLabel.Text = System.Environment.MachineName
File Not Found
|
|
|
|