ふらっとC#,C♯,C#(初心者用) Part35
■ このスレッドは過去ログ倉庫に格納されています
0220デフォルトの名無しさん
2008/12/25(木) 16:44:48object getTypeMaxVal(Type type) {
if (type == typeof(byte)) retun byte.MaxValue;
if (type == typeof(short)) return short.MaxValue;
if (type == typeof(int)) return int.MaxValue;
//省略...
}
の様なメソッドで求めているのですが、もっと簡単な方法があれば、
ご教授願えれば有難いです。
■ このスレッドは過去ログ倉庫に格納されています