Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Sharing Folders

Posted on 2003-03-15
1
Medium Priority
?
1,026 Views
Last Modified: 2008-02-01
Can I share / unshare windows folders using a C# program?
0
Comment
Question by:sumitamar
1 Comment
 
LVL 6

Accepted Solution

by:
martinv earned 200 total points
ID: 8375303
Yes, you could. There are several ways how to accomplish it.

1) call external cmd.exe, and let it carry command "net share xxxx"

2) use WNetAddConnection via p/invoke api. Example could be found here:

http://groups.google.com/groups?hl=cs&lr=&ie=UTF-8&oe=UTF-8&threadm=%23EeJjAhgBHA.1788%40tkmsftngp05&rnum=11&prev=/groups%3Fq%3Dshare%2Bfolder%2BC%2523%26hl%3Dcs%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DN

Martin Vobr
http://www.rebex.net/ftp.net/
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question