473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

create a shared folder does not work in inetpub

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
6 3912
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
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
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
Thanks, Michael

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

May 10 '06 #5
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
I had shown my code when I replied to Peter, -- message part 3

Any ideas?

May 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: GhislainTanguay | last post by:
Hi everyone, i work on a ASP (Not .NET but version 3) project. This project is on our server for development. I use SQL-SERVER, IIS and VB for DLL. On the server i have create a folder with my...
2
by: DCount17 | last post by:
I'm new to .NET and C#. I need help in trying to do the following: I need to use a URI (or something else) that allows all users of the application to be able to access a directory and create a...
0
by: R K | last post by:
Hi all, I am trying to create a Web application with VS.NET 2003 which hangs with a message "Contacting Server to create Web Project MyProject..." After what seems like 10 minutes or so, I...
2
by: tshad | last post by:
I have a program I am trying to compile into a dll and am getting a bunch of: the following errors: error BC30469: Reference to a non-shared member requires an object reference. At first, I...
4
by: TimC | last post by:
I hope someone can help - I am getting desperate! I have promised to do some work for someone developing an ASP.NEt application. I have VS Studio 2002 installed on my pc which is running...
11
by: Andre | last post by:
Hi, I have ASP.NET application running on standalone (not part of the domain) Windows 2003. I use forms authentication for my application. The problem I have is that I need to create and read...
2
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
2
by: §iD` | last post by:
Hi! I would like to create a virtual folder (which I want to mount) and populate managing his content by a DLL or something like that in VB.NET (2.0). How can I acomplish this? Thanks to...
4
by: Keith G Hicks | last post by:
I'm an experienced foxpro, vba, delphi, sql programmer but this is something new to me. I'm creating a pretty simple vb.net exe (scantextfiles.exe) that will run on a server and read some text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.