Questions tagged as '.net'

3
answers

How to write schedules in console entries without repeating too much code

I want all Console.WriteLine to be this way when it is sent to the Console:    [10: 38: 12: 758] - Message typed in WriteLine Well I've done a part that is this: private static DateTime data = DateTime.Now; Console.WriteLine("[{0...
asked by 22.09.2017 / 15:41
2
answers

How to receive information in a View?

I programmed my controller as follows: [HttpPost] public ActionResult Login(string pUsuario, string pSenha) { usuario oUsuario = modelOff.usuarios.Where(p => p.usuario1 == pUsuario && p.senha == pSenha).SingleOrDefault();...
asked by 28.07.2017 / 16:55
2
answers

Switch only enters the "default"

When I read a number, converting it to Int32 , my switch simply understands that it is a default and makes the code described there. static void Main(string[] args) { Jogador j = new Jogador(); //instancia que r...
asked by 19.02.2018 / 14:44
2
answers

How to solve a string formatting error?

I was normally programming in VS in "Console" mode when I come across this message:    "A first chance exception of type 'System.FormatException' occurred in mscorlib.dll   An unhandled exception of type 'System.FormatException' occurred in m...
asked by 10.02.2017 / 04:57
2
answers

How to group text file according to parameters of the first line in C #

I was able to merge several text files from the same directory into a final text file, grouping the same codes and summing their respective amounts, using the following code (credits to friend Vitor Mendes): Dictionary<string, int> valor...
asked by 23.05.2014 / 14:12
3
answers

NullReferenceException error in join

I created a join in LINQ to create a List : (from p in listaProcedimento join pd in oListaprocedimentodetalhe on p.codigo equals pd.codigoProcedimento into pd1 from pd2 in pd1.DefaultIfEmpty() select new ProcedimentoDe...
asked by 02.08.2017 / 13:42
2
answers

Limit file size

I created a file import method. I would like to know how to limit the file to the server.     
asked by 19.02.2016 / 03:24
2
answers

Saving an attribute for image [closed]

I need to save an image and let's say I have something like: namespace Projeto.Models { public class Usuario { public int UserId { get; set; } public String Nome { get; set; } public ? Foto { get; set; } }...
asked by 06.01.2016 / 20:47
2
answers

Write XML from a List

I'm developing a C # Console Application that loads a List and then writes an XML file to the contents of this List. Class public class Equipamento { public int Id { get; set; } public string Marca { get; set; }...
asked by 15.02.2016 / 22:38
2
answers

Why calling a method is not compiling?

using System; using System.IO; namespace testando { public class pessoa { public void Falar(){ Console.WriteLine("Ola meu nome é ninguem"); } } class Program { public static void Main(strin...
asked by 02.09.2018 / 15:34