Questions tagged as 'c#'

2
answers

Problem between C # system and Warsaw plugin (GAS Technology)

My project was built with the C # language. It was all happening smoothly, until some customers started reporting errors when opening my system. The error occurs as follows: the client clicks the shortcut on the desktop and the system opens (usu...
asked by 26.10.2015 / 12:58
2
answers

How to make a LINQ / lambda and consume it in the view?

I have an object called Radio : public class Radio { public int RadioId { get; set; } public string StreamUrl { get; set; } public bool Ativo { get; set; } public bool Mp3 { get; set; } } I'm doing a select in control...
asked by 09.08.2015 / 14:45
4
answers

How to get the name of the property to which a lambda expression refers?

I have a lambda expression being translated into an expression tree, as follows: Expression<Func<object>> expr = () => x.NomeDaPropriedade; How do I get the name of the property, which in this case is NomeDaPropriedade...
asked by 31.01.2014 / 14:36
3
answers

Obtain specific application memory usage

I need to get the memory and CPU usage of an application in C #, with the code below (using PerformanceCounter ) did not get the same value as the Task Manager of Windows . PerformanceCounter cpu; PerformanceCounter ram; cpu = new Pe...
asked by 14.08.2017 / 17:06
2
answers

What's the difference between @ Url.Content ("~ / css / bootstrap.css") and only "/css/bootstrap.css"

I'm learning to program an application based on MVC4 and Bootstrap. Right at the beginning of the project I came across a puzzle: In _Layout.cshtml I had <link href="css/bootstrap.css" rel="stylesheet"> , Bootstrap worked fine i...
asked by 12.12.2016 / 19:09
2
answers

Open View with Parameters [duplicate]

I have this script: $('#Musico').change(function () { var id = $(Musico).val(); var url = '@Url.Action("Votar","Chamada")'; var tipo = 1; $(function ChamaVotar() { $.post(url, { id: id, tipo: tipo }); });//Functi...
asked by 25.11.2016 / 00:31
2
answers

How to redirect user to page after login?

I'm developing a web application, using Asp.Net MVC 5 com Identity and I'm using Roles to perform the authorization. I am trying to do that depending on the Role that the user has, it is directed to a different "Home" pag...
asked by 31.10.2016 / 11:05
2
answers

How does C # run on other platforms?

As a complement to this question , run C # in a where the .NET Framework is native, it is standard to run the application executable. As far as I know, C # depends on the .NET Framework to be compiled and run , and thus have all code functio...
asked by 17.07.2018 / 19:36
3
answers

Char to integer conversion in C #

Reading a blog article, I came across the following syntax for converting char to integer: string value = "123"; foreach (var c in value) { if (char.IsDigit(c)) { int digito = c - '0'; } } I wonder why this conversion wo...
asked by 24.05.2018 / 15:52
1
answer

How can lambda expressions handle stack variables?

I'm learning C # and I'm reading about lambdas expressions. The question that remained is: how does this work and why does it work? public delegate void Test(); public void Foobar(ref Test del) { int var = 10; del...
asked by 12.06.2018 / 18:49