Questions tagged as '.net'

3
answers

How do I delete a file marked with the "read only" attribute?

I'm trying to delete a file that is marked with the "read-only" attribute: Wheneverthefileismarkedwiththisattribute,Igetthefollowingexception:  System.UnauthorizedAccessExceptionwasunhandledIfitisafilewhose"Read-only" attribute is unchecked,...
asked by 03.01.2014 / 19:14
2
answers

What would this "k_BackingField"

I'm having a project to create a Smart Device in C # for Windows CE. I received a reverse engineering result code, but it has a part that I can not understand or adapt. Here is the code: private string <codProduto>k__BackingField; privat...
asked by 14.06.2018 / 06:00
3
answers

How to replace dynamic string {{snippet}} from a string in C #

I get a string which is dynamically generated example: "Dynamic text {{parametro1}}, plus a piece of text {{parametro2}}." I have a code similar to this in C #: where the name is the same as in braces and the value property is the one that...
asked by 05.06.2016 / 23:23
2
answers

Does the ListT.ForEach Method exist?

I'm trying to implement the example of this page , but VS2015 (.NET 4.5) says that the ForEach() method does not exist class Program { static void Main() { List<String> names = new List<String>(); na...
asked by 15.11.2015 / 02:57
2
answers

Sorting data with value priority using LINQ

I have a status table with the following values: ID 1 = Ativo ID 2 = Novo ID 3 = Excluido How would you return a list of objects (which have the status object) prioritizing, coming first, those that have Status 2 (New) using LINQ? I wou...
asked by 16.09.2015 / 18:39
2
answers

Return today's date in C # in specific format

My output must be "2015-02-01" I tried to DateTime.Now.ToString("yyyy-m-d") , but it does not put the 0 between days and months.     
asked by 04.04.2016 / 02:31
2
answers

How can I indicate the directory where my assemblies should be found?

My company has a facility that hits the house of gigabytes. We have a set of applications in our installation that share the same libraries. By default, when .NET runs an application, it looks for the assemblies in the same directory where...
asked by 20.02.2017 / 20:02
3
answers

What should I observe when creating a hash code?

Still talking about answer about hash code it was not clear what should be observed to produce good hash codes . I understand that it needs to be a number that does not generate a lot of repetition, but is this enough?     
asked by 22.03.2017 / 13:16
2
answers

Using String.Replace the string remains the same

I have the following string : string tt= "{\"Response\":{\"StatusCode\":200,\"StatusMessage\":\"OK\",\"Content\":{\"family\":{\"codigo\":14,\"descricao\":\"Cal\u00e7a\",\"frontoffice\":1,\"posicaofront\":31,\"posicaoprint\":26,\"fundo\":\"#c0...
asked by 17.02.2017 / 14:36
2
answers

How does an anonymous type return?

I have a method that should return a collection of anonymous objects: /*Aqui deveria ser o tipo anonimo "AnonymousType"*/ [AnonymousType] ListarAnonimo() { //Especifica um "template" para o tipo retornado. var lista = new[] {...
asked by 11.02.2017 / 22:12