コード例 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DriveInfo[] allDrives = DriveInfo.GetDrives();
            ServerDetailsClassDataContext DataBase = new ServerDetailsClassDataContext();
            ServerDetail Details = new ServerDetail();
            var          Count   = (from rows in DataBase.ServerDetails
                                    select rows).Count();

            foreach (DriveInfo d in allDrives)
            {
                Details.Drive = (d.Name);
                if (d.IsReady == true)
                {
                    Details.AvailableSpace = ((d.AvailableFreeSpace) / 1000000).ToString();
                    Details.TotalFreeSpace = (d.TotalFreeSpace / 1000000).ToString();
                    Details.TotalSize      = (d.TotalSize / 1000000).ToString();
                }
                Details.ID = Count + 1;
                DataBase.ServerDetails.InsertOnSubmit(Details);
                DataBase.SubmitChanges();
            }
        }
コード例 #2
0
 partial void UpdateServerDetail(ServerDetail instance);
コード例 #3
0
 partial void DeleteServerDetail(ServerDetail instance);
コード例 #4
0
 partial void InsertServerDetail(ServerDetail instance);