Questions tagged as 'c#'

2
answers

Monitoring internet connection at run time

I'm using this method in C # to be able to identify whether the computer is connected to the internet or not private bool VerificarConexao() { if (NetworkInterface.GetIsNetworkAvailable()) { return true; }...
asked by 16.12.2016 / 13:15
2
answers

Delete element from an array

I need to delete the first element of an array. I have: Numero[10] . How do I exclude the value in Numero[0] and overwrite the other elements?     
asked by 18.03.2017 / 18:54
3
answers

How to scan data from an Excel worksheet

I have a Mysql database and I want to get the data from an excel sheet and send it to it. I already know how to save the data in the table, you just need to know how to scan the worksheet and get the data.     
asked by 04.01.2017 / 12:56
2
answers

How to program a single check-box the items in a checklistbox?

I need to program in a single check-box, so when it is "marked" select all my files present in a checklistbox and "unchecked" the reverse. I created a check box in my 'check / uncheck all' application, which requires that when I tag it, selec...
asked by 23.10.2017 / 14:22
2
answers

How do I make a function that takes two integers and returns a Boolean value?

I want to do a function that takes two integers and returns a boolean , but when I put the: return (encontrou); It gets an error on top of the encontrou variable. Here is part of my function: public static bool verificar(int cont,...
asked by 01.11.2017 / 03:33
4
answers

How to return values from a List in C #

I have a class Funcionario that has attributes: CPF , Nome and Salario . I have to create an X amount of instances of this class in a List<> and after that, return to the user the values of this list. Wi...
asked by 03.09.2018 / 14:45
3
answers

Logical operator || in C # does not work [closed]

I'm trying to do an exercise where in a range of 0-30 I want to know which numbers are divisible by 3 or 4. Working with a if for each situation works. But if I try to use the logical operator || does not work. It is part of the co...
asked by 19.04.2017 / 17:27
2
answers

Recover External IP without third-party services

I have a WPF application. I need to know the external IP of the machine that is running this application. I found some tutorials that teach to do this through the method DownloadString() of class WebClient consuming some service...
asked by 18.11.2016 / 19:33
2
answers

What is the most efficient way to clean a List (List) with C #?

I have a scenario here where I create a list to check some items, and I need to clear this list inside the loop, and I had some doubts about performance Should I check the list before cleaning? ( .Any() ou .Count > 0 ? ) to not exe...
asked by 12.02.2018 / 10:46
1
answer

Split in single quotes'

I have a string where there are single quotes (') and would like to split but by setting, '''); , it breaks the code. splitString = splitLines[i].Split(' ', ',', ';', '"', '(', ')', '!', '?', ':', '…', '„', '“', '¿', '¡');     
asked by 05.03.2018 / 16:14