Questions tagged as 'c#'

2
answers

Is it right to use string when integer value?

Today I came across a certain situation, which left me with doubts: In my application I have some ID's coming from a table, these ID's are integer values (1,2,3, and so on) and all I treat them as string . One of the re...
asked by 14.10.2016 / 16:46
1
answer

Alternatives to PHP [closed]

And I really like C # so I took a look at ASP, but I did not like it very much. I already moved with NodeJS and I really like it. I wanted a PHP-like language, where you could put the code inside HTML and manipulate it. So: <div>...
asked by 20.12.2016 / 14:47
1
answer

Display or Hide Fields for Individuals or Companies

I have a form that registers Customers, and has the option of being an Individual or Legal Entity, each of which has a few different fields. I thought about using an @Html.RadioButton with the option Individual and Corporate. When you click o...
asked by 07.09.2015 / 23:22
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

Order Queue in C #

I already have this code: Queue<string> Fila = new Queue<string>(); //Declaração da Fila string opcao = "1"; //Define opção como 1 while (opcao == "1") //Enquanto ele quiser inserir pedidos { Console.WriteLine("Cliente:"); //...
asked by 02.07.2015 / 17:18
1
answer

How could I reverse the way a foreach traverses the object? [closed]

Next code: foreach(Control objCtrl in groupBox.Controls) { if (objCtrl is NumericTextBox) { int i = objCtrl.Text.Length; MessageBox.Show(i.ToString()); if (String.IsNullOrEmpty(objCtrl.Text) || objCtrl.Text == "...
asked by 19.09.2018 / 19:12
2
answers

How to open notepad with content inside without saving?

I would like to know how to open notepad using C #, with content generated through a string , but I do not want it to be saved anywhere.     
asked by 03.08.2018 / 01:32
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