|
Characters are encoded and decoded to byte sequences - you can't talk about a byte representation of a string without specifying an encoding.
You will find the encodings in the Text namespace:
System.Text.Encoding.UTF8.GetBytes("DD5FGRT");
People tend to use ASCII and Default (ANSI) encoding as well, and these are indeed great - when interfacing with your grandmothers DOS programs. They do not belong in any serious development today as they can only handle a miniscule subset of text. For the Default encoding, you even have the added benefit that this will change from system to system (or on the same system when someone change regional settings).
If nothing else, you can always check the length of the array, and then loop it to see if it's identical.
|
|
|
|
|
I open the second form from first form.
but the first form can not get the second one with OwnedForms attribute.
whenever it maybe happen?
|
|
|
|
|
You need to set the Owner or Parent property on the form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi
Right now i am stroing dts package in local and executing it. The code what i have written is
Dataset ds=new Dataset();
Package package=GeneratePackage(); //Generate package is a my function
Application app=new Application();
app.SavetoXML("path",package,null);
DtsConnection dtsCon=new DtsConnection();
dtsCon.ConnectionString=package.GetPackagePath();
dtsCon.Open();
DtsCommand dtsComm=new DtsCommand(dtsCon);
dtsComm.CommandText="DataReaderDest";
IDataReader reader=dtsComm.ExecuteReader(CommandBehaviour.Default);
ds.Load(reader,LoadOption.OverwriteChanges,reader.GetScehmaTable().TableName);
return ds;
It is working fine. I would like to execute the package without storing it in local using dtscommand. Can anybody help me please.
kesavan
-- modified at 3:20 Thursday 24th May, 2007
|
|
|
|
|
Could you let me know about Trace Collector, with respect to object cleanup?
Cheers,
Jaya Vidya
|
|
|
|
|
The main thing you need to know about object cleanup, is call Dispose if it's available.
I googled for trace collector, where did you hear about it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I wish to disable toggling of check box in checked list box (C#). If my check box is checked user shall not be able to uncheck it and vice versa but text should be allowed to be selected.
In list box i was able to set colours for items but if i set color i am not able to select any of item. I wish to give colors to items in list box but also i should be able to select the items.
Please help if someone knows the solution of above 2 issues.
|
|
|
|
|
Have you copied the question of your friend from your class?
|
|
|
|
|
Hi,
I wish to disable toggling of check box in checked list box (C#). If my check box is checked user shall not be able to uncheck it and vice versa but text should be allowed to be selected.
In list box i was able to set colours for items but if i set color i am not able to select any of item. I wish to give colors to items in list box but also i should be able to select the items.
Please help if someone knows the solution of above 2 issues.
|
|
|
|
|
Hello,
Ashish_Sood wrote: I wish to disable toggling of check box in checked list box (C#). If my check box is checked user shall not be able to uncheck it and vice versa but text should be allowed to be selected.
It sounds like you don't whant to set "Enabled" to false.
What you can do is handle the "ItemCheck" event and reset the Current value property of ItemCheckEventArgs.
private void checkedListBox1_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
{
e.NewValue = e.CurrentValue;
}
Ashish_Sood wrote: In list box i was able to set colours for items but if i set color i am not able to select any of item. I wish to give colors to items in list box but also i should be able to select the items.
I think you can select, but the color changes if you do so.
Maybe by handling the "SelectedIndexChanged" and reseting the color you can be successfull.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi Experts.
How can i check a condition during the apllication when my application is idle.
Like in vc++ there is a OnIdle() message handler.
Is this like in c#.
Thanks in advance.
|
|
|
|
|
Use the Application.Idle event.
Standards are great! Everybody should have one!
|
|
|
|
|
Hi,
I'm working in a dynamic code generation project. While creating aspx pages, I'm using such code:
string s=<TD><asp:label id=lbl" + ctrlId + ">" + caption.Trim() + " Runat=server</asp:label></TD>" + Environment.NewLine + <br />
"<TD><asp:TextBox id=" + ctrlId + " Runat=server></asp:TextBox></TD>";
But the "Environment.NewLine" doen't seem to function the way it is supposed to, because i don't get output in 2 separate lines. In the output after adding all such html code, I see "\r\n" instead of "Environment.NewLine" and the everything is in the same line in the file.
Could someone point out whats going wrong here.
Regards
|
|
|
|
|
The code is not displayed properly what i copy-pasted. Pls find it below:
<asp:label id="lbl"" +="" ctrlid="" "="">" + caption.Trim() + " Runat=server" + Environment.NewLine +
"<asp:textbox id=" + ctrlId + " runat="server">";
|
|
|
|
|
the HTML i'm trying to paste is not displayed properly here.
|
|
|
|
|
First of all, check 'ignore HTML tags' when posting HTML
second, there is an ASP.NET forum
third, a newline doesn't generate a break in HTML. The <br> tag does. It doesn't need a /, but I would use <br/> to make it XHTML.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: First of all, check 'ignore HTML tags' when posting HTML
Thanks, will do that next time
Christian Graus wrote: second, there is an ASP.NET forum
I posted it here coz I was doing this in C#.
Christian Graus wrote: third, a newline doesn't generate a break in HTML.
I am writing the output to a file, so that I can create an aspx file later. Thats why i used NewLine property.
Regards
|
|
|
|
|
blumenhause wrote: I am writing the output to a file, so that I can create an aspx file later. Thats why i used NewLine property.
OK, that will work in your file, but still won't work in HTML. You can use Newline for formatting, but you need the br tag for the browser.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
the form is not active.
when get new message , how to make the form's icon light?
please give me directions, thanks.
|
|
|
|
|
bool bFlag = true;
private void timer1_Tick(object sender, EventArgs e)
{
if (bFlag)
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\FirstIcon.ico");
bFlag = false;
}
else
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\SecondIcon.ico");
bFlag = true;
}
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Maybe my depiction is blurry.
my meaning with the icon is the rectangle that it delegates a form
in the taskbar.
Are you sure the Icon class can make it glitter?
|
|
|
|
|
you have to attach some cool super-blue leds..
life is study!!!
|
|
|
|
|
I'm quite sure there is an easier method; something like this.focus() or this.activate() but it doesn't seem to work...
On the other side this does work. You'll need to allow unsafe code in your project
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHINFO fInfo);
private void timer1_Tick(object sender, EventArgs e)
{
unsafe
{
FLASHINFO fInfo = new FLASHINFO();
fInfo.cbSize = sizeof(FLASHINFO);
fInfo.dwFlags = 2;
fInfo.hwnd = this.Handle;
fInfo.uCount = 2;
fInfo.dwTimeout = 0;
bool result = FlashWindowEx(ref fInfo);
}
}
}
}
public struct FLASHINFO
{
public Int32 cbSize;
public IntPtr hwnd;
public int dwFlags;
public UInt32 uCount;
public int dwTimeout;
}
|
|
|
|