Questions tagged as '.net'

1
answer

Why should I use the StringBuilder class instead of the String class?

Why these two classes are different, as it seems to me that they could be a single class. For example, the method Append , it seems to me that it does the same thing as the + operator.     
asked by 03.10.2015 / 03:14
4
answers

Should I use a "try-catch" to identify if a password is wrong?

In the login screen, I check the bank with select , and I'm using catch to catch this exception. Is it correct to use catch for this type? if (Usuario != string.Empty && Password != string.Empty) {...
asked by 21.07.2016 / 16:04
5
answers

Test for string padding

When I read a post about good programming practices, more related to validating string fills, I came across the following: Check too slow: string ret = String.Empty; if (string.IsNullOrEmpty(ret)) Slow check: string ret = String.Empt...
asked by 29.08.2018 / 14:03
3
answers

How can I replace a part of a string by itself plus the character "~"?

How can I replace a part of a string with itself plus the "~" character? I am doing this as follows: only when the string has two equal numbers like the 51 that comes shortly after AP and the contained in 17 51 3322 Replace does...
asked by 15.06.2016 / 20:49
1
answer

How does Linq's Aggregate () extension method work?

I recently saw some examples that used the Aggregate() of namespace System.Linq method, but I could not find any good explanation of how to use it. What does this method do and how should it be used?     
asked by 06.10.2015 / 15:22
2
answers

How to access the print screen image?

When we press the Print Screen key on our keyboard, the screen image is saved in some memory cache, somewhere, because when we give Ctrl V after, in Paint for example it apararece, how to access the location and "catch" the image from ther...
asked by 05.05.2014 / 14:04
2
answers

Method equivalent to BigInteger.and () in C #

I need to convert the java code below to C #: public static boolean verificaPermissao(BigInteger perm1, BigInteger perm) { if (perm1 == null || perm == null || (perm1.equals(BigInteger.ZERO) || (perm.equals(BigInteger.ZERO)))) ret...
asked by 04.05.2017 / 19:15
3
answers

What are the consequences of programming in 32-bit or 64-bit?

Would it be only the memory capacity that is limited to 4 GB in 32 bits? Do I need to have specific concerns? I know what's different about C, I want to know about C #.     
asked by 26.04.2017 / 16:01
2
answers

How namespace works in ASP.NET

I do not know ASP.NET, but I had to support a very disorganized third party code by the way. I have a xxxx.aspx file that is in the /cp folder and has these calls: <%@ Page Language="VB" Debug="true" %> <%@ Import Namespace...
asked by 13.05.2014 / 16:09
2
answers

Foreach C # vs ForEach () EF6

Follow the code below: % of EF6%: var result = ctx.Table.Where(x => x.User == "João").ToList(); result.ForEach(x => x.Read = true); ctx.SaveChanges(); ForEach() of C #: var result = ctx.Table.Where(x => x.User == "João...
asked by 07.06.2017 / 20:45