| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
====[[エンコーディング]]を指定してファイルを読む====
<pre>
using System;
using System.IO;
{
string path = @"c:\work\test.csv";
using (var reader = new Stream[[R]]eaderStreamReader(path, System.Text.Encoding.GetEncoding("shift_jis")))
{
string line = null;
while ((line = reader.[[R]]eadLineReadLine()) != null)
{
Console.WriteLine(line);
}
}
</pre>
*以下のようなエラーが出る場合
<pre>
System.ArgumentException: ''Shift_JIS' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. '
</pre>
[[File:Cshart_shift_jis.png|600px]]
<pre>
using System.Text;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
</pre>
 
====CSVファイルを解析(TextFieldParser)====
*http://msdn.microsoft.com/ja-jp/library/x710fk43.aspx
*[[C# LINQ使用例]]
===非同期処理===
====[[C Sharp 非同期処理からUIスレッドにアクセスし画面を更新する|C# 非同期処理からUIスレッドにアクセスし画面を更新する]]====*[[C Sharp 非同期処理からUIスレッドにアクセスし画面を更新する|C# 非同期処理からUIスレッドにアクセスし画面を更新する]] 
====[[C# asyncとawaitの動作確認]]====
*[[C# asyncとawaitの動作確認]]
 
===[[WPF]]===
*http://typea.info/blg/glob/wpf/

案内メニュー