K
Kondapanaidu
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.
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;
strArrayElement=strArrayElement.Substring(0,strArrayElement.IndexOf(":",
0));
ArrSysDrives=strArrayElement.ToUpper();
}
for (int i=0; i<ArrSysDrives.Length; i++)
{
for (int j = 0; j < ArrPossibleDrives.Length; j++)
{
a = ArrSysDrives.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!=null)
{
MapDrive=ArrPossibleDrives;
break;
}
}
Thanks in advance for giving the great inputs
Thanks & regards
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;
strArrayElement=strArrayElement.Substring(0,strArrayElement.IndexOf(":",
0));
ArrSysDrives=strArrayElement.ToUpper();
}
for (int i=0; i<ArrSysDrives.Length; i++)
{
for (int j = 0; j < ArrPossibleDrives.Length; j++)
{
a = ArrSysDrives.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!=null)
{
MapDrive=ArrPossibleDrives;
break;
}
}
Thanks in advance for giving the great inputs
Thanks & regards