自分メモ環境はWinXP Pro
Visual C++ 2010 Express で
=======================================
http://msdn.microsoft.com/ja-jp/library/19czdak8.aspx
// text_write.cpp
// compile with: /clr
using namespace System;
using namespace System::IO;
int main()
{
String^ fileName = "textfile.txt";
StreamWriter^ sw = gcnew StreamWriter(fileName);
sw->WriteLine("A text file is born!");
sw->Write("You can use WriteLine");
sw->WriteLine("...or just Write");
sw->WriteLine("and do {0} output too.", "formatted");
sw->WriteLine("You can also send non-text objects:");
sw->WriteLine(DateTime::Now);
sw->Close();
Console::WriteLine("a new file ('{0}') has been written", fileName);
return 0;
}
=======================================
の様にテキストファイルを保存した場合の保存先は
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\TEST\TEST
Administratorの部分は自分のユーザー名で
TESTの部分は両方ともプロジェクト名です。
0 件のコメント:
コメントを投稿