|
You could use hex coded ascii... (Byte)0x45 -> "45"
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Hi, my code reads a byte which is 0x41 hex. and I would like to convert it to ascii which is character "A"
int hex = s[a];
can somebody help me with this?
Thanks in advanced,
merh
|
|
|
|
|
Ummm... just stick it in a char ?
|
|
|
|
|
|
i am working on a program for school and it requires key input so when i press the "a" key a block of code will execute i would i do this i am using visual C# 2005 express edition i think it is something like Key_Down but i couldnt get it to work thanks is there somethat will run as long as the key is held down?
thanks mike
|
|
|
|
|
xxmikexx wrote: i think it is something like Key_Down but i couldnt get it to work
You handled the KeyDown event of which control or form?? If it's the form, did you also set the form's KeyPreview property to true?
|
|
|
|
|
ya i am working on something so while the "d" key is held down something will happen how would i do this i tried putting it in a button with a tutorial i found but it didnt seem to work it was something like
private void cmdright_KeyDown(object sender, EventArgs e CHANGED SOMETHING HERE)
|
|
|
|
|
The problem is that you used a button, which doesn't have the input focus for very long. Handle the KeyDown event of the Form.
|
|
|
|
|
In textbox..
when ever user write his address, He has to start with Numeric value then after all he can use what ever he want ?
if he not use numreic value, then message come up.
Can anyone help me with that?
-Thanks
Peter
|
|
|
|
|
create an event listener for the textbox textchanged event, parse the string, if the first character (or two or three, etc..) are numeric, then proceed, else, if the first char is not numeric, display a messagebox and clear the textbox.
|
|
|
|
|
but how do i chek that condition...i have to use substring or pls help me with that ?
Peter
|
|
|
|
|
use if(IsNum(textBox1.Text[0])),
As IsNum is a function you may create and takes a parameter of char to check if its a number.
|
|
|
|
|
pakpatel wrote: when ever user write his address, He has to start with Numeric value
Are you really, really sure about that?? You're making a bad assumption here...
|
|
|
|
|
Ya i know but what i do man..that's how they want ?
Peter
|
|
|
|
|
A good app starts with good solid requirements. Your customers are not software developers. They have no concept of what is and isn't best practice. If the customer wants something that is known to be bad practice, it's part of your job to hash this requirement out and make sure that the customer understands that this will affect the quality of the app and spell out what the potential pitfalls are, and have the customer sign off on the bad requirement. The last thing you need is to give the customer everything they wanted and them not give you what you wanted ($$$) because the app didn't do everything they envisioned it doing.
|
|
|
|
|
Agree with Dave. If you give the customer exactly and literally what they wanted, you will find that in the end you have a system that is hard to maintain, with a lot of loop holes, and does not handle situations that did not occurs to the customer that it may happens, at that moment.
|
|
|
|
|
Split the numeric part away from the non-numeric part.
|
|
|
|
|
use Regex when the textbox fires it's Validating event. if the Regex fails, you can clear the box.
http://www.dotnetcoders.com/web/Learning/Regex/syntax.aspx[^]
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Perhaps if you communicated to your client some more concrete examples... There are legitimate addresses that don't start with a number. Private roads sometimes are used
Waverly Place
Anytown, XX, 12345
Sometimes people spell out numbers as well:
One Rockefeller Plaza
Some begin with directions:
West 106 Broadway
As long as you're dealing with a small, known pool of addresses, you'll be OK. However, if you're soliciting general address input, I'd stay away from this rule. Just my 2 cents... Good luck!
|
|
|
|
|
Hello,
So I did my homework and I learned and succesfully created a custom event. Now I want to go to the next level. I want to trigger the event an app1 and hear it on app2. Is it possible? For example. Let's say we created two Console Applications one was just listening and the other one was triggering an event.
|
|
|
|
|
You'll need more than events to communicate between applications.
If the 2 apps are on the same machine, you can communicate between them using pipes. See System.IO.Pipes[^] in the latest .NET framework.
If the 2 apps are on different machines, you'll want to use a robust communication mechanism like Windows Communication Foundation (WCF)[^] or Remoting[^]. WCF is the latest communication technology, Remoting is an older technology.
|
|
|
|
|
Are those water pipes or gas pipes? Thanks. I'll look into it.
|
|
|
|
|
Member 3537109 wrote: Are those water pipes or gas pipes? Thanks. I'll look into it.
Specifically, "Named Pipes".
|
|
|
|
|
There's some articles on here - just search for named pipes[^]
I believe that they can be used across a LAN to communicate between different machines as well. Also, I read somewhere that they're useful for interapp communication in Vista where other methods can fail
Dave
|
|
|
|
|
Hello one and all,
I have strange issue with my .net 2.0 windows application. The application shows an empty error messagebox sometimes (gridrow double click in a datagridview, tab click and in some cases even on application launch). However this only happens with some deployments and gets corrected (no code changes) in the subsequent deployments.
It will be of great help if anyone can help me in resolving this issue.
Warm Regards,
Krishna Murthy
|
|
|
|