Writing into files

Hello, i use VC++ 2010 express. I am making a windows form program.
I want to make a program whitch makes a file containing number of seconds since midnight. I got some code:

1
2
3
4
5
6
7
8
9
10
11
12
...
...
time_t t = time(0);
struct tm * now = localtime( & t );
secA = now->tm_hour * 3600 + now->tm_min * 60 + now->tm_sec;

String^ filename = vardas->Text + L" " + pavarde->Text + L".txt";
StreamWriter^ sw = gcnew StreamWriter(filename);
sw->Write(secA);
sw->Close();
...
...


But when i try to run it it works good, exept the content of file. I get random symbols (some of them: ḡṉṧ).
Any help?
Last edited on
This would go better in the Windows programming forum. If you don't get the answer here, try posting there.

I would love to help but I can't run your code since it's not complete.

If you display the output to a label, does it look correct ?
If you display the output to a label, does it look correct ?
It works correct then. Maybe the problem is something about encoding?

Edit:
This would go better in the Windows programming forum. If you don't get the answer here, try posting there.
But it's not allowed to post multiple times
Last edited on
Topic archived. No new replies allowed.