c# - How do I set a member field to a value using codeDom namespace -


Hi, I want to create a code which is something like this:

  public string stringString = "Some random string";  

How can I set a value for the member field that I have created:

  CodeMemberField field = new CodeMemberField ("System.String", "RandomString");  

Thanks,

found it on another stack overflow question P>

  field.InitExpression = New CodePrimitiveExpression ("Some Random String");  

Comments