|
Here is one way to do it:
const string digits = "0123456789ABCDEF";
string hex = "2A";
int num = 0;
for (int i=0; i<hex.length; i++) num = num * 16 + digits.IndexOf(hex[i]);
The code should of course be improved with some error handling, and allowing for lower case characters also.
---
b { font-weight: normal; }
|
|
|
|
|
Image to to Stream of Byte[]?
I have an image in the pictureBox captured from a device .Now i want to convert this PicBox.Image to stream of bytes to save it in the DataBase.Plz help me how to convert this image from pictureBox to stream of bytes.I pretty know how to save it in database but having some problem converting the image to stream of bytes from
PictureBox.
Thnx in Advance!
|
|
|
|
|
Just use the Save method of the Image class.
PicBox.Image.Save(stream, ImageFormat.Jpeg);
---
b { font-weight: normal; }
|
|
|
|
|
hi,
when i change one record or more i want to show changes to DBGrid which
i have opened it before ! can i refresh DBGRID ?
thanks!
|
|
|
|
|
Assuming you are using a DataSet to provide the data to your DataGrid, clear the data set and then fill it again from the data adapter.
|
|
|
|
|
hi,
i want to run an execute file with c# code but
i don't know?
can you help me?
|
|
|
|
|
Hello,
Please have a look at the following code:
Process newProcess = new Process();<br />
ProcessStartInfo info = new ProcessStartInfo("cmd.exe");<br />
newProcess.StartInfo = info;<br />
newProcess.Start();
HTH.
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
hello to everybody.
I have problem with installation on my problem on another computer with differen language.My program is made on c# the windows version is xp en but computer on witch i want to install it is xp italian.So how to install it.I do this procedure copy my program and past it in other computer.If this is not correc what to do.
Thank you
|
|
|
|
|
And what is the problem?
---
b { font-weight: normal; }
|
|
|
|
|
the problem is because i don't know what framework exacly witch version i shoot download.I download some frame work and now give me error when i start it the error is " mscorwks.dll cloud not be loaded" i look for this file and the file was there ???
|
|
|
|
|
Hi buddies,
If more than one thread may enter .NET collections (ArrayList, NameObjectCollectionBase, ...) Add() methods should I enclose the code that calls Add() in a lock statement?
Also can you tell me a general rule to underestand when I SHOULD call some method only inside a lock statement in a multi-threaded app?
Thank you so much,
- Mohammad
---
"Art happens when you least expect it."
|
|
|
|
|
From MSDN documentation on ArrayList:
"Public static members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe."
As Add() is an instance member, it's not guaranteed to be thread safe, so you should use lock.
The documentation should contain thread safety information for all classes.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, thank you Guffa.
---
"Art happens when you least expect it."
|
|
|
|
|
|
Thank you leppie
---
"Art happens when you least expect it."
|
|
|
|
|
Thank yo leppie
---
"Art happens when you least expect it."
|
|
|
|
|
Hi
I have to use Microsoft.ink in c# and , and just draw a image .. for example: just write a letter say egg using ink and save that image as .jpeg file..
How can i do it . Please anyone tell how to do this..
Dhol
|
|
|
|
|
Hi All,
I have a datagrid in an aspx page. From footer i am adding new row to the data grid. How do i make that datagird is scrollable as well as with Fixed Header and Footer? The header and footer should be visisble aslways then only the end user can add new records.
Could you guys please help?
Thanks
Thennarasu
|
|
|
|
|
Hi
I have a Sql Server datebase in our company on a Server.
I want to read the server Time from the clients and i don't want users can change their computer time .
but I don't know how can i do it.please help me
|
|
|
|
|
With SQL Server, you can run the following select statement to get the time:
SELECT GETDATE()
To set the time, read the source code of the NTPClient class from the article SNTP Client in C#.
To prevent users from changing the clock, investigate the "Change the system time" policy for users in your domain/local computers.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I have an problem in converting the desktop coding in Windows Serice. all the code was translated successfully but the problem i m facing in below code of line when i trying to write this line of code in wnidows service its getting error in Invoke method, its compulsory for me to call this (INVOKE)method cause the parameter inside this are delagate and collection of parameters that i have to pass these in any case, so can any one tell me what should i do to access this INVOKE method in windows service.
Code: this.Invoke(new PingStartedEventHandler(netMon_PingStarted), new object[] { sender, e });
|
|
|
|
|
I presume you're moving this code from a Windows application? If that's true, then the Invoke you are talking about would be Control.Invoke , which I *think* won't be available in a Windows service.
If you're not updating UI elements, I guess you can safely skip the Invoke and directly call the method using the delegate.
PingStartedEventHandler pe = new PingStartedEventHandler(netMon_PingStarted);
pe(sender, e);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi everybody,
I would like to ask a question here.
Is Static function advantage or disadvantage ?
How are they disadvantage ?
Shuold I use many static function in a program ?
Thank for answering my questions ,
Sincerely,
|
|
|
|
|
dinh van hai wrote: Is Static function advantage or disadvantage ?
Depends on the context. Static functions are useful for factory methods like Create, which create and return appropriate objects.
dinh van hai wrote: How are they disadvantage ?
Static functions are like global functions, only that their scope is restricted to the class. So too many static functions and the class then becomes a dumping ground where you keep adding functions that don't fit elsewhere.
dinh van hai wrote: Shuold I use many static function in a program ?
Of course you can. You can take the system defined static functions, like File.Create as a starting point.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
how do static functions affect the performence and memory of our program ?
|
|
|
|