Questions tagged as 'c#'

1
answer

How to get command line parameters / file path

I'm developing an application, and I need it by parameters / commands next to the file path. For example, these flags : C:/caminho_do_arquivo -r C:/caminho_do_arquivo -v And in the code would have regions that would identify this comm...
asked by 02.04.2015 / 20:03
1
answer

Regex get more than one occurrence in a string

I have my regex (\d{2}) . And I have my string 12 hoje vai 45 na serra pelada 55 ou 75 . How do I get my regex to get all occurrences of the string? She's just getting the last one.     
asked by 13.03.2015 / 19:11
2
answers

Standard implementations in interface with C #

I was reading about the new features of C # 8 and I came across Default Interface Implentations , that is, standard implementations in interfaces. The code below exemplifies public interface IBankAccountManager{ void PerformTransaction(...
asked by 07.06.2018 / 18:41
2
answers

File.Exists and Accentuation

I have a system developed in Webforms (eca!) that checks the existence of an image and then displays it. Everything is working correctly, however, when the image path has accents, the File.Exists method seems to be returning false...
asked by 23.05.2018 / 14:20
1
answer

How to check if an email was sent successfully?

I am trying to verify that an email sent from my application is sent successfully, wondering if the recipient receives it or not (full mailbox, invalid email, there). For what I researched, there is deliverynotificationoptions that the ga...
asked by 28.07.2014 / 10:59
1
answer

Working with C # resources?

I added the dictionary resource to my project, now I need to convert it to a dictionary via code, but it is bringing the null resource, can anyone help me? List<string> dic = new List<string>(); List<string> aff = new List<...
asked by 08.08.2017 / 13:32
1
answer

What is the correct way to use RunOnUiThread () in Xamarin.Android?

When I need to update a field in the UI, do I need to run this code in the UI thread ? For example: I have to change the layout of my activity . The code I'm using is this: RunOnUiThread(() => { _layoutBlurred.Visibility = ViewS...
asked by 27.07.2017 / 15:03
3
answers

How to make my program consume less CPU without hindering its execution?

I have a program that reads the memory of a computer process continuously (with while (true) ), but this ends up requiring a lot of CPU, arriving at 20% used, my question is, how to decrease CPU usage without lose performance in the progra...
asked by 13.07.2017 / 23:56
2
answers

Refresh Text bound to a DataBinding

I have the following property bound to a label, where the value of this property appears in the text field. So: this.labelPedidosHoje.DataBindings.Add("Text", pedidosIntegrados, "PedidosIntegradosModelo.PedidosIntegradosDia",true, DataSourceU...
asked by 16.06.2015 / 19:17
1
answer

Read CSV file without saving it

I have following code: [HttpPost] public ActionResult importCSV(HttpPostedFileBase file) { if (file.ContentLength <= 0) { ViewBag.Message = "Nenhum arquivo foi enviado.";...
asked by 09.06.2015 / 16:32