Search results for query: *

  • Users: ken76
  • Order by date
  1. K

    Problem with string array?

    I have a problem with this code, because it gives me following error message Object reference not set to an instance of an object when I use the line values[countValues] = reader2.GetString("textinfo"); in the code below. Can someone help me? public static string[] values; int...
  2. K

    How to use switch case instead of if statements?

    Is it possible to use switch case instead of if statements with the code below this text? if number > 20 { ............ } if number > 30 { ............ } if number > 50 { ............ } if number > 70 { ............ }
  3. K

    Same void between multiple forms in the same project?

    Is it possible to use the same void between multiple forms in the same project? If it possible, how is it done?
  4. K

    How to highlight all rows in listbox between two index values?

    Is it possible to highlight all rows in listbox between two index values? If it possible how is it done?
  5. K

    Is possible to use the same background process for all forms?

    Can I use the same background process for all forms in visual studio c#? If it possible, how is it done?
  6. K

    Mysql database freezes with Visual Sudio C#

    I a'm reading values from raspberry pi mysql database with visual studio c# If the database is not available and I am trying to read from it, the c# app freezes for about 15 seconds. Is it possible to make it not to freeze when checking if the database is available? Her is the code string...
  7. 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?
  8. 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...
  9. 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...
  10. K

    How to skip system volume information?

    Do you have a small example, how it is done?
  11. 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?
  12. 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) => {...
  13. 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...
  14. 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"...
  15. 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...
  16. 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...
  17. 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?
  18. 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...
  19. 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);
  20. 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?
Back
Top Bottom