Details on Stack Overflow

Type t = typeof(string);
                string typeName;
                using (var provider = new CSharpCodeProvider())
                {
                    var typeRef = new CodeTypeReference(t);
                    typeName = provider.GetTypeOutput(typeRef);
                }