Questions tagged as 'c#'

1
answer

Transform Byte Image?

I need to capture an image of a folder in / doc, write its bytes in a text file and save it to another folder in / doc. How can I do this?     
asked by 11.06.2018 / 13:58
2
answers

Bold parameter C # [closed]

I have the following string: string frase = string.Format("A data de hoje é: {0}", DateTime.Now.Date); Is there any way to make the parameter bold?     
asked by 30.08.2017 / 14:57
3
answers

Entity Framework relationship 1: N

Hello. I have the following classes ... Sales Class: [Table("venda")] public class Vendas { public Vendas() { ItensVendas= new List<ItensVendas>(); } [Key] public int Id { get; set; } public...
asked by 16.11.2017 / 00:18
3
answers

How to print the number of words in a string that receives a sentence in .NET?

I would like to print the number of words in a sentence declared within a string . Example: string frase = "Meu carro vermelho é caro" cont = 0; aux = -1; while(frase.lenght() < frase =="") { aux++; if(cont < aux){ con...
asked by 13.09.2016 / 02:48
2
answers

Person registration using multiple viewModels and only one controller

I want to register a person, which I divided into three entities: Person, Contact and Address. And I want it to be just a registration form. My action create in the person controller looks like this: [HttpPost] [ValidateAntiForgeryT...
asked by 20.07.2015 / 20:42
2
answers

How do I convert the size of a file in bytes to KB, MB, GB, TB, etc?

I'm getting the file size to display on the screen: new FileInfo(arquivo).Length This property returns me the total bytes ... I would like to display in a format that I can understand, for example, instead of 2147483647 I want to sho...
asked by 27.12.2013 / 18:16
1
answer

Does C # support GPS?

Is it possible via a computer to find the location of a cell with altitude, longitude and latitude using C #? Is there a library for this? Do I need any specific hardware to implement this idea of locating a device? (Which can be anywhere...
asked by 06.05.2014 / 02:08
4
answers

How to group codes and add existing amounts to text files with C #?

I have several text files inside a directory. I need to do in C # and merge all the text files into a final text file, but handling the contents of them. Example: Arq1.txt 123456010 654321020 Arq2.txt 123456040 654321005 The first 6 cha...
asked by 22.05.2014 / 18:25
2
answers

Convert hexadecimal to integer

I have this value in hexadecimal "E365A931A000000". I need to convert it to integer I'm using the following code. string hex = "E365A931A000000"; CodLibercao = Convert.ToInt32(hex); This code is giving me the following exception:    "...
asked by 03.03.2015 / 21:22
3
answers

How to return values from two different tables?

I'm working on an auto complete script that should search two peer tables (Courses and Packages) (unrelated) and return the merged values in a single list. The problem is that the query below is not returning any value: [HttpGet] public Js...
asked by 07.06.2016 / 20:34