|
You are absolutely right. I was just trying to avoid the next question once he finds out how to receive asynchronously: Why is my application still freezing?
Ok, just kidding. The truth is that I did not pay attention to the code.
|
|
|
|
|
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
hey
- Windows mobile 6.5
- net 2.0
- Form with the x or the ok at the rigth upper corner
what i want to do
- start the program and the button = OK
- if you use a menu the button change to X
all that works but now it comme
if that button = X and i hit it then the program minimize
i want to change this to close the menu
i tryed already wndproc but this don't work in mobile or i don't find it
if any one has suggestions or solutions , links thanks therefore
thanks
|
|
|
|
|
Hi,
I have following string.
"sdate=2,edate=3,,frq=price(sdate=0,,),curn=usd"
I would like to split the above string as below.
string[0]="sdate=2"
string[1]="edate=3"
string[2]="frq=price(sdate=0,,)"
string[3]="curn=usd"
I tried to split based on ',', but I didn't get as above?
Please help.
|
|
|
|
|
SRKSHOME wrote: edate=3,,frq
The thing is you have two ,'s here.
Based on this string[2] will be "".
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
modified on Thursday, October 21, 2010 2:29 PM
|
|
|
|
|
no..string[1] would be edate=3 and string[2] would be ""
|
|
|
|
|
Missed that - thanks.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Look into Regular Expressions.
Also see what I did here[^].
|
|
|
|
|
A simple Split will work for every ',' character into the original string, and it seems that it should ignore the ones which are between parenthesis. You can use regular expressions to achieve this. First of all, replace every ',' character which is between parenthesis with another character easy to replace back when split is finished ('|' could be a good choice). Then make a normal split, and then replace back. This code would work for the sample given:
string originalString = "sdate=2,edate=3,,frq=price(sdate=0,,),curn=usd";
Regex r=new Regex("\\(.+\\)");
string modified = r.Replace(originalString, m =>
{
return m.Value.Replace(',', '|');
});
string[] vector = modified.Split(',');
for (int i = 0; i < vector.Length; i++)
vector[i] = vector[i].Replace('|', ',');
Though vector[3] would be an empty string due to the two consecutive commas after the edate=3. If you want to ignore several consecutive commas into the string, you should make this before the split and after the replacement made by the Regex object:
while (modified.Contains(",,"))
modified = modified.Replace(",,", ",");
Hope this helps. See you
|
|
|
|
|
Hi Erik,
This is realy helpful...Thank you very much.
Thanks.
|
|
|
|
|
hello
i am working on a project "Face Detection" in live video without OpenCv, EmguCV etc. so the first thing that I want to access the RGB values of each pixel and then set them back after some plus minus calculation. but the problem is that i can't use GetPixel and SetPixel methods because they are too slow. and i need heigh speed. in one second i have to process many frames. my question is that is there any other way to get the rgb values and set them back more faster than GetPixel and SetPixel, which full fill my requirements?
thaks
|
|
|
|
|
See here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Sir I don't have words to say thanks to you. you solved a very big problem of mine. God bless you..thank you very much..
i would like to ask one another question and that is.
"Is BitmapData and lockBits and then Unlock bits through pointers is the fastest way to access bits or do we have more faster method then this as well?".
thanks
|
|
|
|
|
Hi all,
There are all these nice types of columns you can add to a DataGridView - ex. DataGridViewCheckBoxColumn and DataGridViewButtonColumn
Is there a way to define my own type for such a column?
What I'd like to do is this; I have a DataGridView on my form in which I display the various values of a list of attributes (I'm not using data binding). The different attributes have different types of values, some are strings, some are integers, some are dates and some are byte values that represent a bit field.
These bit fields I'd like to display in the DataGridView as a group of checkboxes . So I had in mind to create a control that consists of a panel containing 8 check boxes (or something like that) and then display that control in the DataGridView cell. But how?
Any ideas or suggestions would be appreciated.
TIA
|
|
|
|
|
This Link[^] may help you to get some idea
|
|
|
|
|
Hi, all.
I now it's a long posted issue but I have a problem with keyup in my serialport and I can't find a solucion.I Work with a richtextbox to access to the serial and works fine but not the keyup. in console app when I press keyup the machine connected via serialport gives me the last typed command. but not in richtextbox, here do nothing. catching the ConsoleKey/ConsoleKeyInfo in console app and sending the same data on richtextbox doesn't help.
How I can catch the keycode/keydata/keyvalue/ or something for the keyup in cons. app. to use it in richtextbox? seems to be different.
Thanks.
|
|
|
|
|
you have to pass the hex value for the UP key , richtextbox doe's not support the upkey to send the value to your device.., think about alternative..
see below link for hex value for control characters
http://www.gsp.com/cgi-bin/man.cgi?section=4&topic=keyboard[^]
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hi Rajesh, Thanks for your answer.
I need a litle more help. I need to pass the string representation of the hex number of the upkey?
Iam trying this but doesnt work. may i not trying the on rigth way.
Thanks.
|
|
|
|
|
can u provide the code. what you tried.., so that i can help you on this...
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hi. here is the code porcion.
private void rtBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 38)//upkey
{
e.Handled = true; //for not executing on richtextbox directly the answer
//come from another function
serialPort1.Write("{0x26}");//This is the string representation of the
//hex keyup? I found more than one.
}
}
Thanks a lot for your time.
|
|
|
|
|
may be yoy are passing the wrong ASCII code,
0x26 for (Ctrl+Z),
Go through the below link , here all ASCII values are available
Ascii values[^]
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
i'm trying to get files with the a specified extension in a folder using a batch file , but when i give *.resource it doesn't get any file instead it shows "*.resource" with the path. ant idea how to get the file with the extension .resource .
thanx in advance.
|
|
|
|
|
Maybe I am extra thick today, but what does this have to do with C# ?
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
why you are using the batch file to get the file list..,
use the .net methods system.io.directory.getfiles to get the file list from directory..,
go throgh the below link
Get File list[^]
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|