Hi,
I would like find out the server space of the server location as \\ad1hfdtfs001\. I am able to find the Disk space of my local computer. But i am not able to find out the server space for this. Any one please throw some light on this.Any help would be appreciated.
Server Path i want to find out the space is \\ad1hfdtfs001\WebApps\CE_DEV
public void GetvaluesfromArray(string[] getdetails)
{
Nasspace Call = new Nasspace();
string ServerName = getdetails[0];
System.IO.DriveInfo drive = new System.IO.DriveInfo(getdetails[1]);
System.IO.DriveInfo a = new System.IO.DriveInfo(drive.Name);
long Storagenew = a.TotalFreeSpace;
double Storage = ConvertBytesToMegabytes(Storagenew);
//Sarath Adding Method for the Total Space Available
Int64 Toatalspacenew = FreeSpaceissue(getdetails[1]);
double Toatalspace = ConvertBytesToMegabytes(Toatalspacenew);
Int64 Totalvalue = Convert.ToInt64(Toatalspace);
Call.Updatedatabase(ServerName, getdetails[1], Storage, Totalvalue);
}
[WebMethod(Description = "Getdata from the sqldatabase")]
public DataTable Getdetails()
{
Nasspace arr = new Nasspace();
DataSet ds = new DataSet();
SqlConnection sqlCon = new SqlConnection();
SqlDataAdapter sqlAdp = new SqlDataAdapter();
sqlCon.ConnectionString = ConfigurationManager.ConnectionStrings["MSAPConnectionstring"].ConnectionString;
try
{
sqlCon.Open();
sqlAdp = new SqlDataAdapter("select nvarchar1, nvarchar3 FROM userdata where tp_Listid = 'D5B5FA6F-D8E6-4710-8EE6-EBF93ACE2FBF'", sqlCon);
sqlAdp.Fill(ds, "userdata");
foreach (DataTable thisTable in ds.Tables)
{
foreach (DataRow row in thisTable.Rows)
{
object[] values = row.ItemArray;
string[] str = Array.ConvertAll<object, string>((object[])values, Convert.ToString);
arr.GetvaluesfromArray(str);
}
}
sqlCon.Close();
return ds.Tables[0];
}
catch (Exception ex)
{
// log this exception or throw it up the StackTrace
// we do not need a finally-block to close the connection since it will be closed implicitely in an using-statement
throw;
}
}
Regards,
Sarath