I read the contents of the file and take the line in an exact place like this
string fileContentMessage = File.ReadAllText(filename).Substring(411, 3);
The output will always be either Ok or Err
On the other hand, I have a MyObject that has a ContentEnum like this
public class MyObject { public enum ContentEnum { Ok = 1, Err = 2 }; public ContentEnum Content { get; set; } }
Now, on the client side, I want to use such code (to pass the fileContentMessage Content property)
string fileContentMessage = File.ReadAllText(filename).Substring(411, 3); MyObject myObj = new MyObject () { Content =
string enums casting c #
user1765862 Dec 20 2018-12-12T00: 00Z
source share