create a shared folder does not work in inetpub

  • Thread starter Thread starter jzdeng
  • Start date Start date
J

jzdeng

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.
 
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
 
Hello (e-mail address removed),

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 Nietzsch
 
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.
 
Thanks, Michael

Could you please telling me how to set those rights programatically?
 
Hello (e-mail address removed),

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 Nietzsch
 
I had shown my code when I replied to Peter, -- message part 3

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top