2014-01-01から1年間の記事一覧

VisualStudio2013のセットアッププロジェクト

VS2013から http://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054dinstallshieldでなくなったかと思ったけど復活したらしい。

binary read

普通にバッファサイズをおもいっきりとって一回読むのでもいいのかなー public static byte[] GetData( this Stream input, int size ) { byte[] buffer = new byte[Math.Min( 1024, size )]; int totalSize = 0; using ( MemoryStream ms = new MemoryStrea…

エンディアン変更

IPAddress.HostToNetworkOrderとかIPAddress.NetworkToHostOrderがあるのは知ってるけど ネットワークで使うときでないときはなんか違う気がするんだ。 にしてもなんでsignedだけなんだ public static ushort ToBigEndianUInt16( this byte[] source ) { ret…

Mp4ファイル解析

Mp4の再生時間とか知りたかったので解析ツールは↓が便利 http://www.thinmultimedia.com/products/MP4Reader.htmlボックスについての情報 http://xhelmboyx.tripod.com/formats/mp4-layout.txt

Directory全部copy

File.Copyはあるのに! Static Classも拡張メソッドできたらDirectoryに突っ込みたい単純なCopyではなくて、複製?overwriteがtrueなら新しいファイルで上書き。こっちが古かったら上書きされる。CopyDirectoriesだけなら一方向そういえばWindows的にはFolde…

SQL SERVER 全テーブル削除

外部キーもあわせて begin try while(exists(select 1 from information_schema.table_constraints where constraint_type='foreign key')) begin declare @sql nvarchar(2000) select top 1 @sql=('alter table ' + table_schema + '.[' + table_name + '] …

アイコン集

http://www.publickey1.jp/blog/14/windows_azure_5.html

あるオブジェクトのプロパティを文字列で指定して呼び出す

あるオブジェクトのプロパティを文字列で指定して呼び出す拡張メソッド。 public static dynamic GetDynamicMember<T1>(this T1 target, string memberName) { if (target == null) { throw new NullReferenceException(); } var binder = Binder.GetMember(CSha</t1>…

フルスクリーン検出

完全にメモなので後で修正 ほかウィンドウがフルスクリーン時は最前面をやめるってのを考えるref:.d.hatena.ne.jp/ir9Ex/20060821/1156127138using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Runti…