C#, C♯, C#相談室 Part85
■ このスレッドは過去ログ倉庫に格納されています
0103デフォルトの名無しさん
2014/10/13(月) 17:54:23.93ID:u5iAxuZi定義
public static string lineNumber(Exception e) { string ret = e.ToString(); int x = 10; ret =ret.Substring(ret.Length - x, x); return ret; }
呼び出し例
try { throw new Exception(""); }catch (Exception e) { Console.WriteLine("lineNumber: \""+lineNumber(e)+"\""); }
出力例
lineNumber: "s:line 366"
.
■ このスレッドは過去ログ倉庫に格納されています