|
M@u thank you very much. Your suggestion solved the problem. Now I will have to figure out how to do the same but in cases when Russian is not the default language. Probably I will have to learn how to "Create an Encoding with the appropriate Codepage ID". Thanks again. Very helpful.
|
|
|
|
|
Hi..
to create a Codepage by ID or Name you do the following:
<br />
System.Text.Encoding myEncoding = System.Text.Encoding.GetEncoding(encodingName);<br />
or
<br />
System.Text.Encoding myEncoding = System.Text.Encoding.GetEncoding(codePage);<br />
where encodingName is a string and codePage is an int.
you can find out the name of your current defaultEncoding by saying
<br />
System.Windows.Forms.MessageBox.Show(System.Text.Encoding.Default.Name);<br />
or the codepage with
<br />
System.Windows.Forms.MessageBox.Show(System.Text.Encoding.Default.CodePage);<br />
if you want to use a different Encoding check http://msdn2.microsoft.com/en-us/library/system.text.encoding(vs.80).aspx[^].
here you'll find a list with all supported encodings.
Greets.
m@u
|
|
|
|
|
Thanks again! Quick and comprehensive! I'll try that!
|
|
|
|
|
Hi all,
As a part of my application, I'm writing a serial comport driver. This means lots of bytes will be coming in, and I was considering using a generic Queue<byte> to store the incoming data for a while. But I'm really wondering how efficient this is. Does anyone know how the System.Collections.Generic.Queue class performs?
Thanks in advance for any help or suggestions on this...
Standards are great! Everybody should have one!
|
|
|
|
|
Bekjong wrote: and I was considering using a generic Queue to store the incoming data for a while.
I would rather implement this in a byte buffer rather than using the Queue class.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Marc Clifton wrote: I would rather implement this in a byte buffer rather than using the Queue class.
Well the whole point is that I would rather use the Queue class for it's advantages (dynamic sizing, handy dequeue method that drops the bytes I dequeue, etc). I can of course always allocate a byte array as a buffer, that'll perform for sure, but I like the Queue class for these advantages...
Standards are great! Everybody should have one!
|
|
|
|
|
It should perform quite good, if you just set the capacity large enough so that it doesn't have to grow the internal array.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ok, sounds logical... Thanks. Now that I'm at it, would you happen to know if an AutoResetEvent consumes any processor cycles while I'm calling WaitOne() on it?
Standards are great! Everybody should have one!
|
|
|
|
|
No, I don't.
---
single minded; short sighted; long gone;
|
|
|
|
|
I havent seen the internals, but I trust Auto/ManualResetEvent to be fully event driven,
i.e. non-polling. The Windows kernel has the necessary primitives to do this (such as
WaitForSingleObjectEx).
Luc Pattyn
|
|
|
|
|
Yes. WaitOne must at some point check the status of the event it is monitoring, though it is a minimal drain in the overall scheme.
only two letters away from being an asset
|
|
|
|
|
Thanks for the help, I figured the same but just wanted to be sure.
Standards are great! Everybody should have one!
|
|
|
|
|
When you refer to queues, I trust you intend to put either byte[] or text lines in there,
not single chars or bytes.
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: When you refer to queues, I trust you intend to put either byte[] or text lines in there,
not single chars or bytes.
Yep. Thanks again.
Standards are great! Everybody should have one!
|
|
|
|
|
Hi
I am creating a windows application.In this I want to display master detail in one grid.Means i want to place one child grid in parent grid.I searched it on msdn and google but examples are using two grids.One dedicated for master and other one for child.I want to give this functionality in one grid.Deatils may appear by clicking + sign of parent record or ?????
any idea or any help????????????????????
|
|
|
|
|
I know Infragitics grid works this way, but I don't know of any free components.
only two letters away from being an asset
|
|
|
|
|
Do you mean by this that it is not possible with build in datagridview control in C# or i keep on searching?
|
|
|
|
|
Correct
only two letters away from being an asset
|
|
|
|
|
I want to access file attribute of Access.mdb
i.e. Created Date attribute.
How can i access and stored in variable.
please Help me out
|
|
|
|
|
Have a look at the File object in System.IO. It should give you all the info you need.
|
|
|
|
|
Am having difficulty with effective deployment of my application which includes a crystal report.
The added crystal report runs perfectly in the IDE, prior to deployment, but failed after deployment.
Am suspecting the need for a prerequisite file(s) required during deployment.
|
|
|
|
|
Not sure how you deployed so my answer may not help a lot, hope it does though.
If you deployed by using publish from the project properties dialog, then there is a "Crystal Reports for .Net Framework 2.0" prerequisite that can be selected (at least in my install).
Looking at my depoyed app it placed a file "CRRedist2005_x86.msi" in a "CrystalReports" subdirectory of my publish location.
Thanks,
Ware
|
|
|
|
|
hi guys
i m to read these file with out 3rd party tool
.
|
|
|
|
|
Have you tried the office interop assemblies?
|
|
|
|
|
Hello everyone,
i apologize if this a dumb question, but it bothers me since days and as i am a c-sharp newbie i have to ask here
Problem : i want to bind a variable in a class to a form control element.
Example:
namespace testApp
{
class ContainerValues
{
public static ContainerValues gContainerValues = new ContainerValues();
private bool _test1 = false;
private int _test2 = 0;
public bool Test1
{
get { return _test1; }
set { _test1 = value; }
}
public int Test2
{
get { return _test1; }
set { _test1 = value; }
}
}
public partial class ContainerForm : UserControl
{
public ContainerForm()
{
InitializeComponent();
}
}
public partial class ContainerForm
{
private System.Windows.Forms.CheckBox FormTest1;
private System.Windows.Forms.ComboBox FormTest2;
}
What i need now is that the displayed checkbox of the Container Form is bound to the test1 Property of the ContainerValues-Class Instance gContainerValues as well as the selected entry in the combobox FormTest2 is bound to the gContainerValues-Test2 Property. So changing the form value changes the gContainerValues-Value.
Thanks in Advance, and best regards,
AmorphisOne
-- modified at 8:07 Wednesday 7th February, 2007
|
|
|
|