|
I'm not certain, but this could be something to do with garbage collection (C# destructors don't work the same as C++ destructors - clicky[^]) - apparently there's no guarantee that a class's destructor will ever be called (so maybe this is your problem)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Very easy.. replace delegate with anything you need
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
}
private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
Console.WriteLine("Bye");
}
}
}
-
Drew
|
|
|
|
|
Hi,
I am using OpenFileDialog to browse the file path ans select the file path in textbox1 and enter ID and another textbox2 in windowform when user opens first time then next time when they open this form i want the filename and ID to appear automatically whatever they entered before. I know how to use in asp.net with config file but with windowforms any idea ???
Thanks,
|
|
|
|
|
you can set the contents of a text box using it's .Text member
i.e.
when you init the form:
textbox2.Text = SomeStringVariable;
and then when you're done with the form
SomeStringVariable = textbox2.Text;
(so just keep this string in a static variable in your form's class, and it'll remember it)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hello
I have a SQL statement which is long. How do l write it so that it is on serveral lines.
This is what l have tried to do.
<br />
CnnStr = "SELECT student.studentID, student.FirstName, student.LastName" +<br />
"book.bookID, book.Title" +<br />
"FROM student, book" +<br />
"WHERE student.studentID = book.studentID";<br />
This does not work, and anyone tell me how to do this.
Many thanks in advance,
Steve
|
|
|
|
|
add at the beginig and end of an string a space (0x20 char)
your code needs to look like this in order to work
<br />
CnnStr = " SELECT student.studentID, student.FirstName, student.LastName " +<br />
" book.bookID, book.Title " +<br />
" FROM student, book " +<br />
" WHERE student.studentID = book.studentID ";<br />
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
You're missing a comma after Student.LastName
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
To consolidate the above answers:
CnnStr = "SELECT student.studentID, student.FirstName, student.LastName," +
" book.bookID, book.Title" +
" FROM student, book" +
" WHERE student.studentID = book.studentID";
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This may be a dumb question, but does your statement work when it is just one long line?
alphanorm
|
|
|
|
|
Three things:
1. You need to leave the proper spaces between things like Title and FROM.
2. You need to add a comma after LastName.
3. You can also use the @ sign in front of the string to avoid the extra quotes and + signs:
CnnStr = @"SELECT student.studentID, student.FirstName, student.LastName, <br />
book.bookID, book.Title <br />
FROM student, book <br />
WHERE student.studentID = book.studentID";
Regards,
Alvaro
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we. - George W. Bush
|
|
|
|
|
hello all,
Tell me, how to make a site as globalization using CultureInfoConverter. Ie. Translate languages in web page.
Thanks
|
|
|
|
|
codes/w wrote:
CultureInfoConverter
Will not do language translation for you. You have to supply the text in every language you want to support.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi..,
Is any body have a knowledge like how to create a user control like that the description is below:-
[1]ComboBox : TextBox : TextBox : TextBox :
and Also in some fields like textbox in readonly mode and we can change its property at rumtime.
[1]ComboBox : TextBox : TextBox : TextBox :
and it's repeat at the runtime as user use Tab Button
Muhammad Waqas Butt
|
|
|
|
|
|
Im working on a C#2.0 grid control, its on hold for the moment as ive just started uni, but you can have the source if you want, it will be open-source when complete
The example only uses TextBoxes for editing, but new editor types can be created.
http://www.onyeyiri.co.uk/misc/Grid.zip
|
|
|
|
|
Hi~
I use the code in "pocket pc network programming". The code cannot get the body of a email.(return ""). So can any help?
Thanks
|
|
|
|
|
Hi,
By fetching the logical drive from a folder I'd like to test what file system I'm on (NTFS or FAT16/32). Have tried to figure out how that is done but so far been unable to find any useful way to achieve this in neither System.IO or using ManagementObjectSearcher (WMI).
Anyone that can hint me where to look?
|
|
|
|
|
U can obtain that using WMI.
try on www.csharphelp.com/arhives3/arhive585.html?ptintable=yes.
Is 2nd part for WMI and there u will find a full application source code - see list of logical drives in that app.
Hope this will help u .
|
|
|
|
|
Yeah, it looks promising. I'll give it a try on Monday. Have a nice weekend.
|
|
|
|
|
Hi~
The MAPI PR_ENTRYID is a structure consist of 2 members - LPBYTE lpb and ULONG cb.
I would like to know is the LPBYTE is a type of encoded string or what is it? It is an entry ID and I would like to convert whatever number or string. How to convert it ?
(p.s. LPBYTE is the pointer of byte array and the member cb is the array size)
Thanks
|
|
|
|
|
Entry ID is an array of bytes. CDO 1.21 represents it as a String.
You can convert the String to the byte array...
private static byte[] StringToByteEntryId(String strEntryId){
byte[] entryId = new byte[strEntryId.Length/2];
String strByte;
int byteIndex = 0;
for(int n=0; n<strEntryId.Length; n+=2){
strByte = strEntryId.Substring(n, 2);
entryId[byteIndex] = Convert.ToByte(strByte, 16);
byteIndex++;
}
return entryId;
... and vice versa:
private static String ByteToStringEntryId(byte[] bytes) {
StringBuilder result = new StringBuilder(bytes.Length*2);
String currentNumber;
foreach(byte b in bytes) {
currentNumber = b.ToString("X2");
result.Append(currentNumber);
}
String entryId = result.ToString();
return entryId;
}
|
|
|
|
|
Hi, all
i tested creating userControl at runtime using Activator.CreateInstance method.
in testing, I found some different thing about Load Event.
when i designed userControl without ActiveX Control (ex, WebBrowser control), Load Event occurred when it is added to other parent control.(ex : panel.Controls(userControl1))
but, when it is designed with ActiveX Control,
Load Event occurred at CreateInstance method.
I must handle Load event, but it's invoked time is different.
why Load Event Invocation Time is different?
thanks for regards!!
|
|
|
|
|
i am using the axWebbrowser in my app, and was wondering how i might jump to a location within the same page. basically, i'm trying to simulate having an that jumps to a location referenced by elsewhere in the same page. what i have done is inserted the tags into the doc's innerHtml, and later when i try to call navigate(), i dont't know what url to pass it. if it was an external page on disk, i'd just pass it "<location>/page.html#jumptohere" as the url, but since i'm working with the DOM, i dont know what to use as the url to postpend my jump locatino to.
i'm sure there's other ways, too, like jumping to an element using the dom or somethign, but i haven't found it. thanks.
|
|
|
|
|
you should be able to use simply #jumptohere as the url.
Using the DOM it would be
document.location.hash="#jumptohere"
|
|
|
|