在IIS 7中创建文件夹

编程入门 行业动态 更新时间:2024-10-25 00:30:06
本文介绍了在IIS 7中创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

极客, 需要小幅验证...

Hi geeks, Need small verification...

string root = Server.MapPath("~"); string path = Path.GetDirectoryName(root); string brandname = addbrand.Text; bool isExists = System.IO.Directory.Exists(Server.MapPath(@"~/"+path+"/"+brandname)); if (!isExists) System.IO.Directory.CreateDirectory(Server.MapPath(@"~/" + path + "/" + brandname)); if (uploadimg.HasFile) { string FileName = Path.GetFileName(uploadimg.PostedFile.FileName); uploadimg.SaveAs(@root+"/Images/" + FileName); }

path = C:\ inetpub \ wwwroot \(要创建的新文件夹)...上面的代码在本地驱动器中起作用(在E:中创建文件夹,但是当我发布代码并放入IIS并通过IP地址访问Web应用程序时). ..代码不起作用...我的意思是未创建文件夹.... 我是否需要添加任何代码段... ??

path = C:\inetpub\wwwroot\(New folder to be created)... The code above works in local drive(Creates folder in E: but when I publish code and put in IIS and access the web application via IP address... the code doesn''t work... I mean folders are not created .... DO I need to add any code snippets...??

推荐答案

请检查以下链接以获取更多信息.祝您好运! :) 使用C#代码创建IIS 7虚拟目录 使用c#在IIS 7.0中创建虚拟目录.净 Please check below links for more info.Good Luck ! :) Creating IIS 7 Virtual Directory with C# code creating Virtual directory in IIS 7.0 using c#

更多推荐

在IIS 7中创建文件夹

本文发布于:2023-11-28 09:39:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641881.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!