Recent content by ken76

  1. K

    How to trigger an event with a COM port?

    How to trigger an event when the last data was read from COM port after a certain time with C#? Is it possible?
  2. K

    Problem to read Com port with while loop?

    The while loop stop when data reads x, but the buttonTransfer button never gets enabled and the MessageBox message never shows up, but the program does not either freeze. What can be the problem with this code? try { buttonTransfer.Enabled = false...
  3. K

    Problem with BackgroundWorker component?

    When I pushed the Transfer button a second time, I get the this error message, System.InvalidOperationException: 'This BackgroundWorker is currently busy and cannot run multiple tasks concurrently.' Can someone help me with this problem? private void buttonTransfer_Click(object sender, EventArgs...
  4. K

    How to skip system volume information?

    Do you have a small example, how it is done?
  5. K

    How to skip system volume information?

    I have also tried this, but with no success. string[] originalFiles = Directory.GetFiles(sourcePath, "*", SearchOption.AllDirectories).Where(f => !Path.GetFileName(f) == @sourcePath + "System Volume Information").ToArray(); Is this a bad approach?
  6. K

    Question Cancel function does not work with backgroundWorker?

    KenEkholm-3624 asked • 1 sec ago Actions Cancel function does not work this code below. Can someone tell me what is wrong with this code? private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { Array.ForEach(originalFiles, (originalFileLocation) => {...
  7. K

    How to skip system volume information?

    Can someone help me how to skip system volume information with this code? string[] originalFiles = Directory.GetFiles(sourcePath, "*", SearchOption.AllDirectories); logFile.Add("Begin SyncDrive backup procedure."); Array.ForEach(originalFiles...
  8. K

    How to also copy subfolder's new and modifed files?

    This code only copies new and modified files under E:\Document but leaves all the subfolders and their new and modified files uncopied. How do I also get the subfolder's new and modified files also copied? const string sourcePath = @"E:\Document"; const string destPath = @"D:\Test"...
  9. K

    Problem with try catch to show error message.

    I don't get any error message if type a faulty computer name with the code below this text. Can someone help me, how I can get it done? try { buttonStatus.Enabled = false; statusComputer = textBoxComputer.Text; ProcessStartInfo...
  10. K

    Problem to define correctly with writeln?

    I have a problem with this code below this text, more particularly with this row prog.StandardInput.WriteLine(@"systeminfo | findstr / B / C:"Host Name" / C:"OS Version""); How to write the line or define it correctly, that will work with this program? ProcessStartInfo status = new...
  11. K

    'Access to the path 'F:\System Volume Information' is denied.'

    I have also tried to use LINQ like this but this line does work. string[] originalFiles = Directory.GetFiles(sourceFolder, "*", SearchOption.AllDirectories).Where(f => !f.Contains("System Volume Information").ToString()) Can someone help me?
  12. K

    'Access to the path 'F:\System Volume Information' is denied.'

    I get this error message 'Access to the path 'F:\System Volume Information' is denied.' when I run the code below this text. How can I ignore 'System Volume Information'? string[] originalFiles = Directory.GetFiles(sourceFolder, "*", SearchOption.AllDirectories); Array.ForEach(originalFiles...
  13. K

    Problem to show the number's decimal?

    I have problem with the code below this text. It doesn't show any decimals, only the number 0. Can someone help me to correct this code, so it shows also the decimals. In this case it enough with 2 decimals. double answerCount; answerCount = 5 / 20; answerCount = Math.Round((Double)answerCount, 2);
  14. K

    Listview component with two columns.

    Can someone help me how I can get C:\test\ folder's subfolders and theirs last written date in two differents column with listview component? Or give me some code tips?
  15. K

    How to add second column to a listBox component?

    For the moment I can only get the subfolders name of C:\Backup folder to the first column of the listBoxComputer. Have do I get also the last written date of subfolders to the second column of the listBoxComputer? private string rootDir = @"C:\Backup"; private void FormView_Load(object...
Top Bottom