Questions tagged as 'c#'

1
answer

Access controls within a Xaml HUB and c #

I have a problem trying to create a form within a Hub in a UWP application. <Hub> <HubSection> <Datatemplate> <Grid> <TextBox x:Name="txtSerial"/> </Grid> </Datatemplat...
asked by 07.01.2016 / 00:51
2
answers

get IP from the machine in asp.net c #

Good I'm wanting to get the ip of the machine. For that I'm doing this code that when I run it from my website and publish it in my local IIS it works and I get my IP from my machine. IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHo...
asked by 25.07.2018 / 15:26
2
answers

Why does my variable of decimal type only keep integer values?

I have a problem with this code snippet: public decimal consumo_promedio(int serial_mic) { foreach (var item in objconnection.consumo_lco(serial_mic)) { a = a + item.consumo_lco; counter++;...
asked by 29.05.2018 / 21:34
1
answer

Create variable that can be passed from one Windows Form to another and return it to the Main Form

Good morning, I am working as Windows Forms and user controls within C #, which I am working with an application that acts as a clock watch. This first screen acts, like the main screen. Which all users have access to now. Pressin...
asked by 27.08.2018 / 16:29
2
answers

Avoid memory leakage C #

I have a class to make a tree that can be traversed up and down, with reference to the parent node, something like this: public class Nodo { protected List<Nodo> Hijos... public Nodo Padre.... public void Add(Nodo nodo) { n...
asked by 19.09.2018 / 16:23
1
answer

C # Convert to datetime 00:60:00

I have a chronometer with this code: private void cronometro_Tick(object sender, EventArgs e) { seg++; if(seg == 60) { min++; seg = 0; } else if (min == 60) { hr++; min = 0; } str...
asked by 28.08.2018 / 09:12
2
answers

mouse event in C #

I have a panel and inside the panel I have 12 buttons, which are invisible, I want that when mouse enters with the mouse panelEntered I expand a bit and show the buttons and when it comes out with mouseLeave go back to its normal form and hide....
asked by 29.03.2018 / 02:39
1
answer

Pass class type dynamically on a method in c #

Starting from: Person model public class Persona { [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } [Required] public string Nombre { get; set; } [Required] } Buzon Model public class Buzon {...
asked by 23.10.2017 / 15:42
2
answers

Do not fill my datagriview with linq

As a result of my first consultation in this forum, I was suggested to use EF, I am actually learning and it saves me a lot of time in terms of entities, but now I have this problem. I have 4 Data Layers, Entity, Business and Presentation....
asked by 12.09.2017 / 05:10
1
answer

Verify the existence of an email in ASP.NET

I would like to know if there is any way to verify if an email is real. I already used the SMTPCLIENT of C # to send an email, but it does not tell me at once if the email is valid or not. The Idea is like simulating an email, but the answer...
asked by 08.06.2017 / 00:45