Connecting Tech Pros Worldwide Forums | Help | Site Map

create a shared folder does not work in inetpub

jzdeng@gmail.com
Guest
 
Posts: n/a
#1: May 10 '06
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.


Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#2: May 10 '06

re: create a shared folder does not work in inetpub


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




"jzdeng@gmail.com" wrote:
[color=blue]
> 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.
>
>[/color]
Michael Nemtsev
Guest
 
Posts: n/a
#3: May 10 '06

re: create a shared folder does not work in inetpub


Hello jzdeng@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
[color=blue]
> 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?[/color]

---
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


jzdeng@gmail.com
Guest
 
Posts: n/a
#4: May 10 '06

re: create a shared folder does not work in inetpub


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:[color=blue]
> 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
>
>
>
>
> "jzdeng@gmail.com" wrote:
>[color=green]
> > 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.
> >
> >[/color][/color]

jzdeng@gmail.com
Guest
 
Posts: n/a
#5: May 10 '06

re: create a shared folder does not work in inetpub


Thanks, Michael

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

Michael Nemtsev
Guest
 
Posts: n/a
#6: May 10 '06

re: create a shared folder does not work in inetpub


Hello jzdeng@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 :)
[color=blue]
> Could you please telling me how to set those rights programatically?[/color]

---
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


jzdeng@gmail.com
Guest
 
Posts: n/a
#7: May 10 '06

re: create a shared folder does not work in inetpub


I had shown my code when I replied to Peter, -- message part 3

Any ideas?

Closed Thread