I have used CodeDOM to generate C# code but I'm not able to generate code for following line of statement.
string FileName=String.Empty;
FileName=Path.GetFileName(file1);
From above code I have written the code for first line using following snippet
using(CodeVariableDeclarationStatement strFileName =
new CodeVariableDeclarationStatement(typeof(string), "strFileName",
new CodeTypeReferenceExpression("String.Empty"));)
but not able to add code for second line using codeDOM. So please let me know how can I achive it.
CodeAssignStatementCodeTypeReferenceif you're not going to reference a type. Also, that seems like a new question to me, so you should ask about that in a new question.