|
i'm not aware of anyway to force the XSD tool to do that, and don't want to make manual changes on that kind of scale.
Your looping solution's offbase for what I want. Since the xml files values are in the "ItemNNN" format, I want to use that one app wide, not the "NNN" format.
I was able to work around this issue a third way. I'd still like to know how to deal with the original issue of not being able to create the same form of the enum that the xmlserializer does when reading the file, but it's became an academic issue for the moment.
I've been refactoring the code related to these objects agressively, and in the process managed to remove almost all of the cases where I was converting a Number to/from a string/int representation. The only remaining locations were places where I was creating the string intermediate, passing it, and imediately recreating the Number object on the other side of the call. My bypass was just to pass the Number directly.
|
|
|
|
|
Int32 connectionFlags = 0;
Int32 connectionName = 1024;
StringBuilder lpSzConnectionName = new StringBuilder(connectionName);
Int32 dwReserved = 0;
Int32 expectedResult = (Int32)(Cookie_Helper.ConnectedStateFlags.INTERNET_CONNECTION_LAN | Cookie_Helper.ConnectedStateFlags.INTERNET_CONNECTION_PROXY | Cookie_Helper.ConnectedStateFlags.INTERNET_RAS_INSTALLED | Cookie_Helper.ConnectedStateFlags.INTERNET_CONNECTION_CONFIGURED);
Boolean GetStateResult = Cookie_Helper.InternetGetConnectedStateExA
(
ref connectionFlags,
lpSzConnectionName,
connectionName,
dwReserved
);
Log.Trace("Received Connection={0}", lpSzConnectionName);-->Nunit Log Statemet
The above code retriving some junk data instead of Default Connection.Could somebody tell me the reason.
Regards,
Visala
|
|
|
|
|
|
Hi!
( Forgive some mistake in my text, I am Vietnamesse)
In VB when I design some labels, I can set its have a name, but their Index different. When event happen, I base on their Index in order to treat. But in C#, I could not found "Index" in Property of Label. What can I do, when I manage 400 Labels?
Can you help me?
Thank for read!
III
|
|
|
|
|
tosen_z wrote: But in C#, I could not found "Index" in Property of Label. What can I do, when I manage 400 Labels?
Use "Tag" property.
<br />
int index = 1;<br />
label1.Tag = index;<br />
....<br />
int val = -1;<br />
if (label1.Tag != null)<br />
val = (int) label1.Tag;<br />
<br />
<br />
Best regards, Alexey.
-- modified at 6:58 Monday 17th April, 2006
|
|
|
|
|
I don't find any property like tag in my Label
Which version of dotnet that U R Using?
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
You're right. Only Framework 2.0.
In this case, you can identify them by location.
Or by name - concatenate some string to name, and then parse it.
Label[] labels = new Label[100];
for (int i = 0; i
|
|
|
|
|
Oh!Great to Hear tat U r Working on 2.0
I still did n't get an opportunity to work on it
Lucky U are!
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Thankyou!
But, if I have 400labels, to catch "OnMouseDown", do I must write 400funtions (each of labels has a funtion)? If not, I can group all and set event is "OnMouseDown", but how to know "label_1" but not is "label_2", when I click on one?
Thank for read!
III
|
|
|
|
|
You can get the index of label by this code on mouse down event
<br />
private void SplashForm_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
int index = int.Parse(((Label)sender).Name.Replace("Label_",string.Empty));<br />
}<br />
Your label names must be: Label_1, Label_2, Label_3 ....
But I think 400 labels isn't good decision.
Can you use some custom control instead ?
Best regards, Alexey.
|
|
|
|
|
Thank you verymuch!
I know, 400 labels isn't good decision, That make my Program slowly. But, I could found the other instead!
My project is a game that name "Caro". In that game, have 2 player, one use character "X", the other use "O", put on a "space game"( that is 400 labels, a matrix 20*20).
When I design 400labels, automatic, C# will create separately 400 labels. To overcome, I myseft write code in "InitializeComponent()" funtion is "System.Windows.Forms.Label[] myLabels=new System.Windows.Forms.Label[400]"... then it not visible in "Form1.cs [Design]" but haven't any error, and when I build it, and press "F5", in my window of "Form1", I can see immediate 400labels??????? I don't understand!
Thank for read!
III
|
|
|
|
|
I try to draw one pixel wide dashed lines in gdi+, but the result is very different from the one obtain with the gdi api functions. Te big problems are on diagonal lines or the lines which are not horizontal or vertical. If someone knows how to draw this lines in gdi+ with the same visual efect as in gdi please answer. I try with or without SmoothingMode, with or without PixelOffsetMode but the results are no better.
The best difference is on custm dotted lines with one pixel on - one pixel off
-- modified at 9:28 Thursday 20th April, 2006
|
|
|
|
|
Hello there
I have an image with Jpeg compression. When I try to load that file it gives me error "out of memory". Can any one guide me how to load the file ?
Image img;
img.FromFile("C:\\test\\1.tiff");
For Sample image with Jpeg Compression please download from the link below.
http://www.alm-soft.com/Rizwan/1.tiff[^]
I shall be very thankful to you for your kind support.
regards
Rizwan Bashir
-- modified at 5:15 Monday 17th April, 2006
|
|
|
|
|
Here's how you use the FromFile method:
Image img;<br />
img = Image.FromFile("C:\\test\\1.tiff");
---
b { font-weight: normal; }
|
|
|
|
|
Thanks but if you download the image file and run this code it will not work.
this image has jpeg compression you can load it in office document imaging but cannot in .net.
|
|
|
|
|
There is something wrong with the file. Some programs will open it, but Photoshop refuses to. How have you created the file?
---
b { font-weight: normal; }
|
|
|
|
|
this is a tiff file compressed with jpeg algorithm.
when I scan the image my scanner returns me this format image
-- modified at 7:35 Monday 17th April, 2006
|
|
|
|
|
This happens because GDI+ doesn't fully support JPEG compression in TIFF files. You'll have to either use an uncompressed version of the file or one compressed using LZW.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I found that very few programs open this file. Further exploration found that it uses a largely obsolete form of JPG compression. Check if there is a new driver for your scanner. You could also try using IrfanView (a free program) to batch convert your scans.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
i am trying to write a c# program communicating to a device (PLC) using socket. the communication is in hexadecimal. everything are alright - socket connection, socket send and received etc. i had created a byte array for the socket's send.
for example, 2 bytes are use to send a decimal value of 100. this is fine.
byte[1] = 0x00;
byte[2] = 0x64; // 64 hex = 100 dec
however, i am having problem to send a decimal value of more than 255. for example, to send a decimal value of 300,
byte[1] = 0x01;
byte[2] = 0x2C; // 12C hex = 300 dec
if i read back form the bytes array, instead of getting the decimal value of 300, it's becomes 144 - byte[1] = 1 and byte[2] = 44.
i am not quite sure if i should use byte array to store the hex value since it will be converted to hex decimal value separately. i had tried to use string array but enventually i still need to convert to byte array in order for the socket to send out. the smae
i am looking forward for your advise. thanks indeed.
Regards,
CC Pang
Software Engineer
|
|
|
|
|
The device probably needs a signed byte, so try that
|
|
|
|
|
johnly wrote: if i read back form the bytes array, instead of getting the decimal value of 300, it's becomes 144 - byte[1] = 1 and byte[2] = 44.
That's exactly what you put in the array, you are only adding the values wrong.
256 * 1 + 44 = 300
---
b { font-weight: normal; }
|
|
|
|
|
I want to generate dll in C# for stringConnection by using exception handling concepts.First I have to check whether the database exist or not,if the database exist then ok otherwise error message should be displayed "Database does not exist" ,if the table is there in the database if the record is there in the table otherwise "eror message" should be fired.
Binu Koshy
|
|
|
|
|
Do you have any specific problem with this task or do you expect us to give you complete code.?
www.troschuetz.de
|
|
|
|
|
completed code
Binu Koshy
|
|
|
|