Fórmulas e Cenas

Object Reference Not Set to Instance of an Object

  Home  |   Contact  |   Syndication    |   Login
  39 Posts | 0 Stories | 6 Comments | 0 Trackbacks

News

Archives

Post Categories

Links

December 2009 Entries

As found in: http://www.personalmicrocos... public static Encoding GetFileEncoding(String FileName) { Encoding Result = null; FileInfo FI = new FileInfo(FileName); FileStream FS = null; try { FS = FI.OpenRead(); Encoding[] UnicodeEncodings = { Encoding.BigEndianUnicode, Encoding.Unicode, Encoding.UTF8 }; for(int i = 0; Result == null && i < UnicodeEncodings.Length; i++) { FS.Position = 0; byte[] Preamble = UnicodeEncodings[i].GetPrea... bool PreamblesAreEqual...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

In this category I will post some "creative" solutions to problems. (Code changed to protect the inocents). // The WTF way int myInt = Int32.Parse(myDataTable.Row... + ""); // The correct way int myInt = myDataTable.Rows.Count;
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati