Click here to Skip to main content
15,912,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: Decimal roundoff problem (solved) Pin
Dave Kreskowiak23-Jan-07 2:14
mveDave Kreskowiak23-Jan-07 2:14 
QuestionCAO serialization on Client side [modified] Pin
mdzieg22-Jan-07 7:03
mdzieg22-Jan-07 7:03 
AnswerRe: CAO serialization on Client side Pin
Marc Clifton22-Jan-07 8:06
mvaMarc Clifton22-Jan-07 8:06 
GeneralRe: CAO serialization on Client side Pin
mdzieg22-Jan-07 8:31
mdzieg22-Jan-07 8:31 
AnswerRe: CAO serialization on Client side Pin
mdzieg22-Jan-07 11:51
mdzieg22-Jan-07 11:51 
GeneralRe: CAO serialization on Client side [modified] Pin
mdzieg23-Jan-07 6:32
mdzieg23-Jan-07 6:32 
QuestionProgrammatically sharing a drive Pin
Marc Clifton22-Jan-07 6:52
mvaMarc Clifton22-Jan-07 6:52 
AnswerRe: Programmatically sharing a drive Pin
Rick van Woudenberg22-Jan-07 9:42
Rick van Woudenberg22-Jan-07 9:42 
Hey Marc,

I haven't figured out yet how to share a complete drive, but I did manage to share individual folders. I understand why you want to share an entire drive, especially when it's a local drive. There is no need in sharing each individual folder. If your drives look like mine then there's probably ten million of 'em. I though I just post the file sharing solution anyway, is case you're interested.

This is done through the FileShare enumerator.

The .NET Framework provides the File class equipped with methods to create, save, open, copy, move, delete, or provide detailed information about, files. Based on its functionality, the File class is typically used to assist the other classes with their processing operations. To effectively provide this support, all File's methods are static; which means that you will usually not need to declare a File variable to access them. One of the valuable operations that the File class can perform is to check the existence of the file you want to use. For example, if you are creating a new file, you may want to make sure it doesn't exist already because if you try to create a file that exists already, the compiler may first delete the old file before creating the new one. This could lead to unpredictable result, especially because such a file is not sent to the Recycle Bin. On the other hand, if you are trying to open a file, you should first make sure the file exists, otherwise the compiler will not be able to open a file it cannot find. To check the existence of a file, the File class provides the Exists method. Its syntax is:

public static bool Exists(string path);

If you provide only the name of the file, the compiler would check it in the folder of the application. If you provide the path to the file, the compiler would check its drive, its folder(s) and the file itself. In both cases, if the file exists, the method returns true. If the compiler cannot find the file, the method returns false. It's important to know that if you provided a complete path to the file, any slight mistake would produce a false result.

The values of the FileShare enumerator are:

FileShare.Inheritable: Allows other file handles to inherit from this file
FileShare.None: The file cannot be shared
FileShare.Read: The file can be opened and read from
FileShare.Write: The file can be opened and written to
FileShare.ReadWrite: The file can be opened to write to it or read from it

Perhaps you could play around with the enumerator and get it to work.

Cheers,
AnswerRe: Programmatically sharing a drive Pin
Scott Dorman28-Jan-07 6:39
professionalScott Dorman28-Jan-07 6:39 
QuestionUsing LDAP for user authentication Pin
mav.northwind22-Jan-07 6:35
mav.northwind22-Jan-07 6:35 
QuestionData Grid View Setting Current Row Pin
Jawa200622-Jan-07 6:31
Jawa200622-Jan-07 6:31 
AnswerRe: Data Grid View Setting Current Row Pin
Marc Clifton22-Jan-07 6:42
mvaMarc Clifton22-Jan-07 6:42 
Questionc# Pin
Member 321217722-Jan-07 6:13
Member 321217722-Jan-07 6:13 
AnswerRe: c# Pin
GaryWoodfine 23-Jan-07 6:48
professionalGaryWoodfine 23-Jan-07 6:48 
Questionc# Pin
Member 321217722-Jan-07 6:12
Member 321217722-Jan-07 6:12 
QuestionFind active user under Fast User Switching Pin
Dave Midgley22-Jan-07 5:14
Dave Midgley22-Jan-07 5:14 
QuestionWhat the heck... Pin
Ray Cassick22-Jan-07 5:01
Ray Cassick22-Jan-07 5:01 
AnswerRe: What the heck... Pin
Marc Clifton22-Jan-07 5:11
mvaMarc Clifton22-Jan-07 5:11 
AnswerRe: What the heck... Pin
tgrt22-Jan-07 5:22
tgrt22-Jan-07 5:22 
GeneralRe: What the heck... Pin
Ray Cassick22-Jan-07 5:26
Ray Cassick22-Jan-07 5:26 
QuestionMerging image segments into one image Pin
MayyMagdy22-Jan-07 4:48
MayyMagdy22-Jan-07 4:48 
AnswerRe: Merging image segments into one image Pin
Luc Pattyn22-Jan-07 6:09
sitebuilderLuc Pattyn22-Jan-07 6:09 
GeneralRe: Merging image segments into one image Pin
Rick van Woudenberg22-Jan-07 8:24
Rick van Woudenberg22-Jan-07 8:24 
GeneralRe: Merging image segments into one image Pin
Luc Pattyn22-Jan-07 8:59
sitebuilderLuc Pattyn22-Jan-07 8:59 
QuestionSitemap and role based access (custom roles) Pin
harinath22-Jan-07 4:40
professionalharinath22-Jan-07 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.