private bool Is空き不足() { try { string file = this.OutFile; if (StringTools.IsLocalDiskFullPath(file)) { DriveInfo di = new DriveInfo(file[0] + ":"); long size = di.TotalSize; //long free = di.TotalFreeSpace; long free = di.AvailableFreeSpace; long free_kb = free / 1000; long free_mb = free_kb / 1000; double freeRate = (double)free / (double)size; int freePct = IntTools.ToInt(freeRate * 100); if ( freePct < Gnd.I.SettingData.DiskFreeOnOutput_Pct && free_mb < Gnd.I.SettingData.DiskFreeOnOutput_MB ) { return(true); } } } catch { } return(false); }
public PrimeRangeOutputDlg(ulong minval, ulong maxval, string outFile, bool countMode, bool divMode = false) { this.Minval = minval; this.Maxval = maxval; this.OutFile = outFile; this.CountMode = countMode; this.DivMode = divMode; InitializeComponent(); this.Text = "Prime64 - " + this.Minval + " to " + this.Maxval + (divMode ? " (出力ファイル分割)" : ""); this.Chk出力先ドライブの空き領域が逼迫してきたら中止する.Visible = countMode == false && StringTools.IsLocalDiskFullPath(this.OutFile); this.Chk出力先ドライブの空き領域が逼迫してきたら中止する.Checked = Gnd.I.SettingData.CheckDiskFreeOnOutput; this.TTip.SetToolTip(this.Chk出力先ドライブの空き領域が逼迫してきたら中止する, null); // LblNode追加で、要らなくなった。 // old /* * this.TTip.SetToolTip( * this.Chk出力先ドライブの空き領域が逼迫してきたら中止する, * this.OutFile[0] + * " ドライブの空き領域が、" + * Gnd.I.SettingData.DiskFreeOnOutput_MB + * " メガバイト未満且つ " + * Gnd.I.SettingData.DiskFreeOnOutput_Pct + * " パーセント未満になったら、自動的に中止する。" * ); */ { string text = this.LblNote.Text; text = text.Replace("$F", "" + Gnd.I.SettingData.DiskFreeOnOutput_MB); text = text.Replace("$P", "" + Gnd.I.SettingData.DiskFreeOnOutput_Pct); this.LblNote.Text = text; } }