How the real code can work with the GUI
am 01.12.2007 02:18:27 von AllenHi Everybody,
I would appreciate it if you can give me a hand here.
I want to use the code in the coming paragraph to do the following when the
"IN" button is clicked (InBtn_Click):
1- Create (or open) output.txt, and
2- Type the current time (hour only) in it.
FileStream* fs = new FileStream(S"output.txt", FileMode::Create);
StreamWriter* sw = new StreamWriter(fs);
String* TimeString = System::DateTime::Now.ToString("HH");
sw->WriteLine(TimeString);
sw->Flush();
sw->Close();
I tried to include the above code inside the handle function in the coming
paragraph, but it does not work. Can anybody tell me who I am going to use
the above code and where I am going to place it? The user interface works
well, how are we going to make the real program work .
private: System::Void InBtn_Click(System::Object * sender,
System::EventArgs * e)
{
if ( mark == '-') //if mark == '+' that means everything is ok
{
MessageBox::Show(" You can't sign in twice! ",S" Error ");
}
}
Thanks.
Allen