!!!C# [Visual Studio][VC++] !!言語まとめ C# {{amazon 4873116503}} *言語まとめ C# *プログラミングC# 第7版(1) *プログラミングC# 第7版(2) !概要 *[言語仕様 3.0|http://download.microsoft.com/download/B/6/C/B6C2DA74-08F9-4B18-BB10-CF6DB1A5CFE2/csharp_30_specification.doc] *言語まとめ C# *C# サンプルコード *プログラミングC# 第7版 !Win32 API DLL の利用 *C# Win32 API および DLL の利用 !!Windows Forms !C# Windows Forms Tips *C# Windows Forms Tips !C# 設定情報を保存する *C# 設定情報を保存する !!データベース !SQL Server Compact *SQL Server Compact デスクトップ用アプリケーションの構築 !!制御 !書式 *[[書式|C# 書式]] !Sleep *[[Sleep|C# Sleep]] !!画面・コントロール ![[グラフ|C# グラフ]] *[[グラフ|C# グラフ]] ![[タスクトレイ|C# タスクトレイ]] *[[タスクトレイ|C# タスクトレイ]] *[[バックグラウンドで動く|C# バックグラウンドで動く]] !!リソース !文字列 *[[文字列|C# 文字列リソース]] !!デバッグ *[[デバッグを行う|C# デバッグを行う]] !!Visual Studio !Visual Studio 2010 Express C# *Visual Studio 2010 Express C# !コーディング規約 *[C# のコーディング規則|http://msdn.microsoft.com/ja-jp/library/ff926074.aspx] *[クラス ライブラリ開発のデザイン ガイドライン|http://msdn.microsoft.com/ja-jp/library/ms229042.aspx] *Effective C# 4.0 !!Tips *[[Subversion プラグイン|Visual Studio Ankhsvn (Subversion Plugin)]] *[[文字コード変換|C# 文字コード変換]] !string を stream に変換 return new MemoryStream(Encoding.UTF8.GetBytes(value ?? "")); !ディレクトリを再帰的に表示 class Program { static void Main(string[] args) { var me = new Program(); me.Parse(args[0], 0); } private void Parse(string path, int depth) { var indent = new string(' ', depth * 2); foreach (var entry in Directory.EnumerateFileSystemEntries(path)) { var attr = File.GetAttributes(entry); if (attr.HasFlag(FileAttributes.Directory)) { Console.WriteLine($"{indent}{Path.GetDirectoryName(entry)}\\"); this.Parse(entry, depth + 1); } Console.WriteLine($"{indent}{Path.GetFileName(entry)}"); } } } !SHIFT-JIS 文字列から、SO SI を除去 var encShiftJis = Encoding.GetEncoding("shift_jis"); int lino = 1; using (var reader = new StreamReader(path, encShiftJis)) { string line = null; while ((line = reader.ReadLine())!=null) { byte[] bytes = encShiftJis.GetBytes(line); for(int i=0;i (b != 0x20 /*space*/ && b != 0x61 /*'a'*/)).ToArray(); bytes = bytes.Where(b => (b != 0x0E /*SO*/ || b != 0x0F /*SI*/)).ToArray(); } line = encShiftJis.GetString(bytes); Console.WriteLine($"{indent}{lino++:D4}:{line}"); } }