Questions tagged as 'c#'

2
answers

What does an enum with the [Flags] attribute mean and how does it work?

I was seeing how the FileInfo class works and I came across an enum: [Serializable] [ComVisible(true)] [Flags] public enum FileAttributes { ReadOnly = 1, Hidden = 2, System = 4, Directory = 16, Archive = 32, Devi...
asked by 03.01.2014 / 19:13
2
answers

Create objects without reference C #

My question is, I have two instance of the class Parents, pais1 and pais2, I created the 3rd instance of the class called pais3 and said that it will be the same as the pais2 instance, until everything is ok. My problem is that when I change...
asked by 14.06.2017 / 00:58
2
answers

Replace letter by empty or blank, something like Replace ("letters", "")

There is a A1_ZTEL field in the database that is varchar(15) . This way, each user entered a record of all forms, with bar, dot, comma and letter. Now I need to mount a form and read this field from another table that is var...
asked by 11.04.2018 / 21:47
1
answer

How to set the file size in a Download response?

I have an application where I give a response by downloading a certain file on the server to the client. I zipo the image files that are in a folder on the server and give a response by manipulating the headers so that the file is downloaded....
asked by 30.11.2017 / 16:48
2
answers

ArrayList versus List

What's the point in C # should we give preference to using List instead of ArrayList ?     
asked by 09.08.2017 / 15:01
2
answers

What's the difference when creating a class libray (.net framework) and class library (.net standard) project in VS2017?

What are the differences and uses of these types of projects?     
asked by 08.11.2017 / 12:44
2
answers

Treat Exception by Code

In Visual Basic 6 there was the err.number command where the error code occurred. I have a C # application that treats exception for the message description because I can not find the command that returns the error code. I have a pro...
asked by 10.04.2018 / 19:01
2
answers

ComboBox is not being populated by the Items I want

I have a ComboBox filled in from a list created with information obtained from a txt file. But instead of being filled with the information of the file he is receiving inside it ----- > GeraRelatorio.Planta , would you like to know why...
asked by 27.08.2018 / 14:14
2
answers

Try catch can be replaced with using?

I've always used the blocks try , catch and finally when programming in Java, and when I switched to C # I noticed that some codes change try/catch by using . Example: using (FileStream fs = new FileStream("...
asked by 07.08.2016 / 03:19
1
answer

Are static members collected by GC when they are no longer needed?

In a class that has a static variable, it exists throughout the application. Is the linked object collected at some point? Example: public class Exemplo { private static List<int> lista = new List<int>(); }     
asked by 10.05.2017 / 16:16