编程方式创建的网站新的用户目录 [英] Programatically create directory for new user on web site
问题描述
我刚刚上传我的网站去爸爸有code,当用户创建我的网站上的帐户创建动态地根据用户ID的目录。它不创建目录,所以我想我需要设置在某种程度上权限,但因为我的网站被托管,我没有控制权IIS。我如何编程设置权限?
如果(Directory.Exists(路径))
返回true;尝试
{
Directory.CreateDirectory(路径);
}
您只能在提供给您的网站的根Web目录创建文件/子目录。
而GoDaddy的可能提供您的登录使用,你可以设置你的目录权限的控制面板。
以下是建立在GoDaddy的帐户权限的过程:
- 使用您的用户名/帐号和密码登录
- 单击在我的帐户
- 单击上托管帐户列表
- 单击打开上(要打开网页寄存包)
- 向下滚动到内容后,点击文件管理器
- 选择您要设置权限,然后单击权限上控制栏上按钮的站点文件夹
- 设置所需的权限,然后单击确定。
块引用>I just uploaded my site to Go Daddy and have code that creates a directory dynamically based on a user id when the user creates an account on my site. It's not creating the directory so I suppose I need to set permissions in some way but I don't have control over IIS since my site's being hosted. How do I programatically set permissions?
if(Directory.Exists(path)) return true; try { Directory.CreateDirectory(path); }
解决方案You can create a file/sub directory only within the root web directory provided to your website. And GoDaddy might have provided you a login to a control panel using which you can set permissions in your directory. The following is the process to set up permissions on a godaddy account:
- Login using your user name/account number and password
- Click on My Account
- Click on Hosting Account List
- Click on Open (the web hosting package you want to open)
- Scroll down to content and click File Manager
- Select the domain folder you want to set permissions for and click permissions button on the upper control bar
- Set the required permissions and click OK.
这篇关于编程方式创建的网站新的用户目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!