编程方式创建的网站新的用户目录 [英] Programatically create directory for new user on web site

查看:162
本文介绍了编程方式创建的网站新的用户目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚上传我的网站去爸爸有code,当用户创建我的网站上的帐户创建动态地根据用户ID的目录。它不创建目录,所以我想我需要设置在某种程度上权限,但因为我的网站被托管,我没有控制权IIS。我如何编程设置权限?

 如果(Directory.Exists(路径))
                返回true;尝试
{
    Directory.CreateDirectory(路径);
}


解决方案

您只能在提供给您的网站的根Web目录创建文件/子目录。
而GoDaddy的可能提供您的登录使用,你可以设置你的目录权限的控制面板。
以下是建立在GoDaddy的帐户权限的过程:


  

      
  1. 使用您的用户名/帐号和密码登录

  2.   
  3. 单击在我的帐户

  4.   
  5. 单击上托管帐户列表

  6.   
  7. 单击打开上(要打开网页寄存包)

  8.   
  9. 向下滚动到内容后,点击文件管理器

  10.   
  11. 选择您要设置权限,然后单击权限上控制栏上按钮的站点文件夹

  12.   
  13. 设置所需的权限,然后单击确定。

  14.   

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:

  1. Login using your user name/account number and password
  2. Click on My Account
  3. Click on Hosting Account List
  4. Click on Open (the web hosting package you want to open)
  5. Scroll down to content and click File Manager
  6. Select the domain folder you want to set permissions for and click permissions button on the upper control bar
  7. Set the required permissions and click OK.

这篇关于编程方式创建的网站新的用户目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆