|
And YES, I did use a Stream. I just thought that seeing some basically working code might help?
Could you post some example code which outputs the result of "type text.txt" to a textbox, so I can see some complete code?
Cheers
Sid
P.S.: process' and difficulties. Consider my prior post corrected
|
|
|
|
|
How to obtain the server name of the one machine or the office land online SQL SERVER2000?
|
|
|
|
|
The problem has been solved with sqldmo
but How to get the password of sa user of Sql Server2000?
|
|
|
|
|
I need code to verify email in win form, help!
|
|
|
|
|
You'll have to be alot more specific about what you want. Verify an email? I take that to mean "does it conform to the RFC specification". Or are you trying to verify an email address is in the correct format? Are you trying to find out if the email address even exists? (Can't be done BTW...)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to verify an email address as if it is in the correct format, can you help?
|
|
|
|
|
Simple. You can use a Regular Expression to check the format and legal characters.
See my last post on this here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i using matlab in calcul power system i don't know how convert matlab file exe or m file in c# to using gui in c#. and how c# acess to m file in matlab.
|
|
|
|
|
How could I order "categories" in the propertygrid according to my will?
|
|
|
|
|
Depends...
if it is your own properties use the Category attribute:
[Category("MyCategory")]
public int MyInt
{
get{...}
set{...}
}
if you whant to change category on derived properties, u have to override the properties and do as above, but alas not all properties can be overridden.
-spif2001
|
|
|
|
|
I believe I saw (on Google somewhere) that adding multiple \t 's before the category name allows you to change the order.
Never tried it though
|
|
|
|
|
Thanks a lot for your message!
But my question was about ordering of "categories" for propertygrid representation.
I know how to use this attribute.
|
|
|
|
|
I want to add a column to my data grid for a treeview structure; where every cell in the column would be a TreeNode object. I wrote a class DataGridTreeNodeColumn that overrides DataGridColumnStyle but you can't just draw a single TreeNode. You have to add the TreeNode to the TreeView and use the TreeView to draw it.
Is it even possible to put a treeview inside a datagrid using this method? Is there another way of doing it? Are there any tutorials that explain how to do this? Thanks in advance.
|
|
|
|
|
Hi
Is there a event which fires when any text gets in to the textbox, either i type or copy paste. I know its possible in keypress and mousedown events but i want a single event where i can identify when a text gets into a textbox. plz do reply if its possible or not.
Cheers!
Cheetu
|
|
|
|
|
|
Hi everyone,
I am just wondering how I can start/restart SQL Server 2000 instance or MSDE programmatically through C#? Does Microsoft have those built-in API?
Cheers!
|
|
|
|
|
|
How can I define a struct like this in C/C++
struct XXX
{
byte b[5];
}
I did it like this
struct XXX
{
byte[5] b; // compile error CS0650
}
another question: how to get component offset in the structure. like in C
int offset = offset(XXX.b);
|
|
|
|
|
You're in the C# forum, you need the C++ forum.
A struct is just a class that defaults to public access ( unlike in C# ). Did byte b[5] cause an error ? My C++ is too rusty for me to answer without checking, but the C++ forum has lots of people who can help.
BTW, a struct is just a class with default access of public. In C#, it's a whole different story.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'm sorry. I think I should clarify my question. My question is about C#, I want to define a byte array in a structure ( a user defined data type ). This can be easily done in C/C++ like
struct abc
{
byte b[5];
}
My question is may I define a structure in C#, which contains a byte array? similar to about example.
Thank u for your input.
|
|
|
|
|
public struct XXX
{
byte [] xx;
}
Your problem is that a struct cannot have a parameterless constructor, so you can only provide constructors that set this value by passing it in. However, you CAN add a property, which could be:
byte [] xx
{
set
{
System.Diagnostics.Debug.Assert(value.Length <= 5, "XXX.xx must be an array of 5 bytes or less");
etc.
Or you could be nice and just copy the first 5 bytes of a larger array, it depends what the struct value really is, and what is valid behaviour for your situation. Half a comment may be OK, half an IP address probably isn't.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
It also depends on whether he needs to match a struct (e.g. return values) or if he simply wants to use it internally.
In the latter case, he could simply use an object instead, which would allow him to use parameterless constructors.
Cheers
Sid
|
|
|
|
|
How can I define a struct like this in C/C++
struct XXX
{
byte b[5];
}
[StructLayout(LayoutKind.Sequential)]
public struct XXX
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
public byte[] b;
}
This assumes that you want to pass the struct to an unmanaged function.
If you don't want to pass the struct to an unmanaged function take a look at the last example in this article - Using Structs in C#[^]
another question: how to get component offset in the structure. like in C
int offset = offset(XXX.b);
I don't think its possible with C#
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
I'm trying to locate the VS.Net icons used for their drop down smartthingy.
I'm writing a pluggin, and was hoping to use the icons as displaying all the class types etc, in text, is becoming a major chore.
How can this be done? Prefferably without breaching any copywrite laws etc.
Cheers guys
Cat
|
|
|
|
|
I dont know whether it will breach the copyright law or not. The icons have been in the assembly itself as a resource. You can use the tools like .NET Reflector to see the icons. An easy way, make a screenshot and cut it from it
|
|
|
|