我能够在我的电脑上打开一个目录,但是当我将我的网站部署到GoDaddy时,我无法打开它。我假设它是某种安全控制。以下是我做的以下行动:
以下代码用于打开在该目录中创建的文件夹:
protected void btnOpenFolder_Click(object sender, EventArgs e)
{
//Path to the customer's folder
string FolderPath = @"C:\" + customerId.ToString().PadLeft(4, '0') + " - " + lblName.Text;
if (System.IO.Directory.Exists(FolderPath))
{
//Opens the customer's folder
System.Diagnostics.Process.Start(FolderPath);
}
else
{
Response.Write("<script>alert('Must have the Dropbox directory in order to open the customer folder.');</script>");
}
}
任何建议都会很棒。提前谢谢!