|
Trim only removes characters from the beginning or end of a string.
---
b { font-weight: normal; }
|
|
|
|
|
|
the best solution is Guffa's answer
string sub = "12.10";
MessageBox.Show(sub.Replace(".",string.Empty));
result is 1210
|
|
|
|
|
Hi all,
I'm working in C# with a unmanged Dll that provides me a pointer to a byte buffer (768x576) that holds some video data. Is there any fast way to access the data and work e.g. with a bitmap object?
Currently I'm converting the data by the help of: System.Runtime.InteropServices.Marshal.ReadByte
But that is to slow for me.
Any suggestions?
Thanks,
Snow.
|
|
|
|
|
|
Thanks for your hint.
But I knew already that I can use pointers and I also used code simiar to the example. What I dont like in this solution is the "byte per byte" transfer to the new buffer. Isnt there a way to copy a complete block (like in C++ "memcpy" wich should be faster than a byte per byte transfer)?
Thanks again
Snow
|
|
|
|
|
MDI Container has child forms, in VS.net2003 automatically "Windows" menu (is menu u can cascade forms for example) shows child forms' names but at VS.net 2005 menuitem object doesnt have any property you can set to show names. :S
How can i do?
|
|
|
|
|
Is there any way i can skip this message, its not so bad on one computer, i can just click, do not show this message again.
But how can i unblock the app for other computers.
|
|
|
|
|
Hi all,
i have created a text editor in c# using the RichtextBox,
But when i set a Font and try to type something the text gets typed in the
default font i.e. Microsoft San Serif
i am working on a Japanese XP machine
I also want to type text in japanese with some Japanese fonts
Any help in this will be great
Thanks
Pramod
|
|
|
|
|
take a look this maybe is same and for Japanese characters
http://www.c-sharpcorner.com/Code/2002/Jan/MultilingualSupportKS006.asp
|
|
|
|
|
Thanks
but i am already working on a Japanese XP machine,
Hope for some more help
Pramod
|
|
|
|
|
I'm in one class and would like to use a string that was defined in another class. Ho to...
|
|
|
|
|
Is the string a static member or instance member? A static member can be referenced without object references like
MessageBox.Show(ClassWithString.MyString);
If it's an instance member, you have to create an instance and then refer to it like
ClassWithString cws = new ClassWithString();
MessageBox.Show(cws.MyString);
Of course, I'm assuming that ClassWithString is accessible from your code and that the string is public. HTH.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Here is an article on passing values between forms[^] (Remembering that a Form is just another type of class)
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Hi all,
I have devloped a Remote Managment App. where server captures the
updated regions of its screen and sends to client.
Problem is that server captures the area which is updated and then
sends. Updation is so frequent and so quick if i will try to send
all the updates as they occur then i think evrything will stop.
So i stores the updates info into a queue and then get them one by one
and sends to client. It looks all will be fine but after some data
tranfer my client stops receiving data. Why i dont know?
What protocol i have to use to make my session a reiable one and
to minimize memory usage by removing intermediate queue?
Thanx
|
|
|
|
|
The protocol probably isnt the problem. You may be overloading the receive buffer of the client so that it stops accepting data, or any number of other problems. You may want to send black and white only with your remote management, especially if you are currently using 24 or 32 bit colors. With black and white 1 byte can represent 8 pixels and will go MUCH faster than having to transmit 4 bytes for each pixel. There is a HUGE number of things that could be happening, but I doubt the protocol you are using is a large part of it.
C#Guy
|
|
|
|
|
A couple things, since your monitor application is busy screen scraping choosing a protocol that is reliable is probably the best choice. In other words, TCP over UDP. The reason is with UDP, datagrams can be dropped, duplicated, or sent out of sequence. The latter does not bode well for a monitor client. Sure you could build in a retry and sequence mechanism but why? TCP will do that for you.
So now you have to further decide to proceed with managing the I/O. For one, having a real-time expectation may be a tad unrealistic. You will probably have to back off your update interval to a few seconds. At the minimum make it a tunable paremeter so that you can see performance on the fly.
The other huge consideration is what is your I/O model? If you app is already multi-threaded then you will probably want to use one new thread to scrape and enqueue or scrape and send. If you choose to buffer between the screen scrape and the actual send, make sure you use a AutoResetEvent or Mutex to signal the Send Thread it is time to send (i.e. updates are in queue).
If you architecture is asynchronous then you absolutley need to make sure your TCP I/O is also asynchronous. In other words use a non-blocking socket and use Begin/End for connect/accept, send/recv operations.
Mike Luster
|
|
|
|
|
I need to write an image viewer program, it will be a C# app, and I need it to run in the clients browser, and handle download of .NET etc. I've been searching MSDN but can find no info ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
hi!
i inherit a windows form then added a property named ListControl that is a control type.
if i'll set the value for this property, the list of possible values were already filtered by control type.
what i want is to filter it again by datagrid and listbox. so it's just like having a second level filter. how can i do this?
any ideas or suggestions will be appreciated!
thanks in advance!;)
-- modified at 3:53 Monday 19th December, 2005
|
|
|
|
|
Hi!
I am looking into how possibly I could enable users re-arrange items in a listbox or listview by dragging an item from one index into the desired index.
Nana
|
|
|
|
|
Hello,
I am writing two programs, one in c++ and the other in c# and am using windows messaging for communication between them. As of now, the c++ program successfully sends a message to the c# program and the c# program receives it just fine. I need the c# program to send a reply message to the c++ program after it finishes its tasks. I have ran into some problems. First off, here is the code in c# that I am using to define the SendMessage function...
DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern IntPtr SendMessage(IntPtr hwnd, uint Msg, int wParam, int lParam);
I did some research on this dll import and found multiple variations, here is one...
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);
does anyone know the correct variables to used so a c++ program will accept the message.
further more...
I tried both declarations of SendMessage and the c# program still did not send a reply message. Note, I used spyxx.exe to find this out. I saw that the message from the c++ program was received but no reply was sent out by the c# program.
here is how I am sending the reply message in c# program...
Form1.SendMessage( Form1.FindWindow("ConsoleWindowClass", "camController"),
REPLY_PICTURE_READY,
0,
0);
I would greatly appreciate input on this, thanks
Roy K
|
|
|
|
|
hi
I know only basic of C# but not in depth like interfaces,delgates,polymorphism and methods in which i am very poor
Can anyone prescribed me any good book or websites .
thanks in advance
kal13na13
|
|
|
|
|
|
Jesse Liberty's Programming C#, on O'Reilly press. $40 new, probably can get used for $30ish. The approach is really one of "ok, so you know the basics of programming in general, here's how you program in C#." Its not C# for dummies, its C# for programmers.
|
|
|
|