-2

文字列をコードに入れたいnameので、テキストボックス入力によって名前が付けられたフォルダーを作成できます。このコードを変更するにはどうすればよいですか?

string name = txtUsername.Text;
string path = Server.MapPath("~/here the string name /");

if (!Directory.Exists(path))
{
    Directory.CreateDirectory(path);
}
4

1 に答える 1

2
string path = Server.MapPath("~/" + name);
于 2015-04-16T20:18:19.663 に答える