Here is my code:
public static string HDDData()
{
string Timestampy = null, TotalSpace = null, SpaceLeft = null,
PercentageLeft = null;
TotalSpace = GetTotalFreeSpaceGB();
SpaceLeft = GetTotalSpaceGB();
PercentageLeft = GetTotalFreeSpacePercentage();
Timestampy = Timestamp();
var HDD = new HDDFormat
{
TotalSpace = TotalSpace,
SpaceLeft = SpaceLeft,
PercentageLeft = PercentageLeft,
Timestamp = Timestampy
};
return HDD;
}
This is the HDDFormat:
public class HDDFormat
{
public string TotalSpace { get; set; }
public string SpaceLeft { get; set; }
public string PercentageLeft { get; set; }
public string Timestamp { get; set; }
}
The data you get are correct strings. (.ToString() doesn't work either)
public override string ToString()and then define how exactly it should be converted to string.HDDFormatorstring? How should that string be formatted?public static HDDFormat HDDData()?