|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Create new drive in a System using C#I am using .NET 1.1 along with 2K Professional Operating System. How to create a new drive in a system which is not available in my system. Example: My System is having the A,B,C,D,E these drives.. I need to create another drive like F which is not available. I have the code for this... Any body give the smart Idea rather than this One.. This is my code.. string [] ArrPossibleDrives=new string[]{"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P" ,"Q","R","S","T","U","V","W","X","Y","Z"}; string [] ArrSysDrives=new string[10]; string strArrayElement; string MapDrive=""; int a; ArrSysDrives=System.IO.Directory.GetLogicalDrives(); for(int i=0;i<ArrSysDrives.Length;i++) { strArrayElement=ArrSysDrives[i]; strArrayElement=strArrayElement.Substring(0,strArrayElement.IndexOf(":", 0)); ArrSysDrives[i]=strArrayElement.ToUpper(); } for (int i=0; i<ArrSysDrives.Length; i++) { for (int j = 0; j < ArrPossibleDrives.Length; j++) { a = ArrSysDrives[i].CompareTo(ArrPossibleDrives[j]); if(a==0) // If Exists=0 else returns -1 { ArrPossibleDrives[j]=null; } } } for(int i=0;i<ArrPossibleDrives.Length;i++) { if(ArrPossibleDrives[i]!=null) { MapDrive=ArrPossibleDrives[i]; break; } } Thanks in advance for giving the great inputs Thanks & regards *** Sent via Developersdex http://www.developersdex.com *** "Kondapanaidu" <kondapanaidu> wrote in message What do you mean by creating a new drive? Do you want to create a partition? news:OQMISPXSGHA.4956@TK2MSFTNGP09.phx.gbl... > Hi, > > I am using .NET 1.1 along with 2K Professional Operating System. > > How to create a new drive in a system which is not available in my > system. Map a drive letter to a volume? Map a network share? Or do you just want to figure out what the next free drive is(which is sorta what your code sample looks like it's doing?) You can't just create drives like directories and there is no support in the framework to do anything remotely like any of the possiblities(unless you are just trying to figure out the next free drive), but if you can tell me what you mean exactly I might be able to find out if it can be done natively. Show quoteHide quote > > Example: My System is having the A,B,C,D,E these drives.. > > I need to create another drive like F which is not available. > > I have the code for this... > > Any body give the smart Idea rather than this One.. > > This is my code.. > > string [] ArrPossibleDrives=new > string[]{"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P" > ,"Q","R","S","T","U","V","W","X","Y","Z"}; > > string [] ArrSysDrives=new string[10]; > string strArrayElement; > string MapDrive=""; > int a; > ArrSysDrives=System.IO.Directory.GetLogicalDrives(); > for(int i=0;i<ArrSysDrives.Length;i++) > { > strArrayElement=ArrSysDrives[i]; > strArrayElement=strArrayElement.Substring(0,strArrayElement.IndexOf(":", > 0)); > ArrSysDrives[i]=strArrayElement.ToUpper(); > } > > for (int i=0; i<ArrSysDrives.Length; i++) > { > for (int j = 0; j < ArrPossibleDrives.Length; j++) > { > a = ArrSysDrives[i].CompareTo(ArrPossibleDrives[j]); > if(a==0) // If Exists=0 else returns -1 > { > ArrPossibleDrives[j]=null; > } > } > } > for(int i=0;i<ArrPossibleDrives.Length;i++) > { > if(ArrPossibleDrives[i]!=null) > { > MapDrive=ArrPossibleDrives[i]; > break; > } > } > > Thanks in advance for giving the great inputs > > Thanks & regards > > > *** Sent via Developersdex http://www.developersdex.com *** Hi,
I am mapping drive with another system.i.e(My server) There some files is there I need to fetch those files into my system. For that I am mapping with that system. I need One letter to map. Which is not available in my system. Example: My system is having A,B,C,D,E I need 'F' volume to Map that drive.. Thanks & regards *** Sent via Developersdex http://www.developersdex.com *** HI,
> I am mapping drive with another system.i.e(My server) There some files You can execute net like : "net use f: \\servername " , you can use the > is there I need to fetch those files into my system. > > For that I am mapping with that system. > I need One letter to map. Which is not available in my system. Process class -- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
STL and DLL linkage (VC71/ VS2003) - Warning C4251
OT: US job market The 'Interface' Type - Unique to .NET? command line interface programming question XMLWriter Anyway to produce Doc with no encoding Info> From ASPX page, can't access file on another PC on network real & transparent proxy Best practice for n-tier data access in .NET 2.0 How can I play "standard system sounds" in C# ? Help understand type casting |
|||||||||||||||||||||||