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...
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
{
............
}
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...
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...
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...
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?
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) =>
{...
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...
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"...
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...
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...
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?
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...
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);
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?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.