By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,985 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,985 IT Pros & Developers. It's quick & easy.

create a shared folder does not work in inetpub

P: n/a
Hi, All

I use VS 2005 to create a web service. The web service is used to
create a sheared folder. It works fine we I run it from VS 2005. But,
when I move it to inetpub, it does not work (folder is created but is
not shared).

Does anyone know how to solve this problem?

Thanks.

May 10 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Do you want to post a "Short but Complete" snippet of working code so our
cadre of expert folder sharers can help you out?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jz****@gmail.com" wrote:
Hi, All

I use VS 2005 to create a web service. The web service is used to
create a sheared folder. It works fine we I run it from VS 2005. But,
when I move it to inetpub, it does not work (folder is created but is
not shared).

Does anyone know how to solve this problem?

Thanks.

May 10 '06 #2

P: n/a
Hello jz****@gmail.com,

Did you get any kind of errors?
The most obvious reason could be the rights issue, you could have limited
righs to share folder
I use VS 2005 to create a web service. The web service is used to
create a sheared folder. It works fine we I run it from VS 2005. But,
when I move it to inetpub, it does not work (folder is created but is
not shared).
Does anyone know how to solve this problem?


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 10 '06 #3

P: n/a
Thanks, Peter

The cod eI used to create shared folder is:

try
{
Directory.CreateDirectory(fileUploadPath);
ManagementClass managementClass = new
ManagementClass("Win32_Share");

ManagementBaseObject inParams =
managementClass.GetMethodParameters("Create");
ManagementBaseObject outParams;

inParams["Description"] = @"Directory for Image File
Upload";
inParams["Name"] = "temp";
inParams["Path"] = "c:\temp2";
inParams["Type"] = 0x0;
inParams["Access"] = null;

outParams = managementClass.InvokeMethod("Create",
inParams, null);

if((uint)(outParams.Properties["ReturnValue"].Value) != 0)
{
throw new Exception("Unable to shared directory.");
}
}
catch(Exception ex)
{
if (log.IsErrorEnabled)
{
log.Error(string.Format("Can not create shared {0}.
Error: {1}", shardFolderName, ex.Message));
}
}
I used it in a web service. When the web service run from VS 2005, the
shared folder c:\temp created. But, when I moved the web service to
inetpub, the c:\temp2 created but it was not a shared folder.

Thank.


Peter wrote:
Do you want to post a "Short but Complete" snippet of working code so our
cadre of expert folder sharers can help you out?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jz****@gmail.com" wrote:
Hi, All

I use VS 2005 to create a web service. The web service is used to
create a sheared folder. It works fine we I run it from VS 2005. But,
when I move it to inetpub, it does not work (folder is created but is
not shared).

Does anyone know how to solve this problem?

Thanks.


May 10 '06 #4

P: n/a
Thanks, Michael

Could you please telling me how to set those rights programatically?

May 10 '06 #5

P: n/a
Hello jz****@gmail.com,

I guess u need try to play with rights in the folder property.
But you need to show your *working* code demonstrating you problem to get
help from us.
There are hardly any extrasensory persons :)
Could you please telling me how to set those rights programatically?


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 10 '06 #6

P: n/a
I had shown my code when I replied to Peter, -- message part 3

Any ideas?

May 10 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.