Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
4
votes3
answers1154
viewsHow to verify if there is a specific value (string) in a list in C#?
I am trying to mount a select Multiple input and leave marked the options that are already present in a certain list. I’m a beginner in C# so the logic of what I need would be more or less this:…
-
4
votes2
answers4221
viewsHow to use HTML Agility pack?
How to Use HTML Agility Pack my project in Visual Studio in C#, as I have a table extracted by an object webbrowsers, the more I go splits in it it stands like an array of almost 700 indexes, I…
-
4
votes1
answer1875
viewsConvert encoding CP850 to UTF8
I have a BD Paradox that returns me the following string after a query in a table of the sector that a certain worker is: Manutenþòo Elútrica. Actually it should be Electrical Maintenance. I need to…
-
4
votes1
answer150
viewsStatic Code Analysis - Identify possible division by Zero
Does anyone know / built some logic (rule) of static source code analysis (for Fxcop or Gendarme) that searches for possible gaps in the code that incur a division by zero? That is, a logic that…
-
4
votes1
answer1976
viewsCalling an executable other than Process in c#
Is there any way to call an executable other than by process? I need something that does not use the code below to call an executable because when I finish a process of an application that is not…
-
4
votes2
answers2456
viewsEnd a C# process with WPF
I have a solution that has two projects. a main project and another that serves as Updater. To perform the upgrade, within the main project, I call a console application as follows. private void…
-
4
votes1
answer491
viewsHow to create a Managed Thread in C++ similar to the example in C#
In C# I use the following code to create Managed Thread: Thread thread = new Thread(new ThreadStart(minhaFuncao)); In C++ i made: using namespace System::Threading; . . Thread^ thread = gcnew…
-
4
votes2
answers1311
viewsHow to get position of a sub-list within another list?
I have a list of bytes and I need to check if it contains a sub-list of bytes in a specific order. How can I do this check by getting the position of the sub-list in a simple way, using the…
-
4
votes2
answers5206
viewsFile supposedly being used cannot be deleted
I have a software that records error logs of itself inside a "logs" folder. Each log file is created with the current day date, so it is unique to the current day. Example: 30-04-2014.log. I use…
-
4
votes1
answer145
viewsHow to change the type of the persisted class in a legacy model using the Entityframework
I have the following class scheme with inheritance, as an example: public class Veiculo { public int Id { set; get; } public string Descricao { set; get; } } public class Moto : Veiculo { } public…
-
4
votes1
answer952
viewsAdding Referenced DLL to a C#Executable
I developed a console application in C# that makes use of a referenced dll. After batch build and generating the application executable, I tried to run it on a computer that did not have this dll,…
-
4
votes4
answers4106
viewsInstantiate class as another class’s Property
I have two classes created within the same namespace, being: public class Pessoa { public int idPessoa { get; set;} public string nome { get; set;} } public class PessoaFisica { public Pessoa pessoa…
-
4
votes3
answers7464
viewsRound numbers in C# to decimal 0 or 5
I need to round up numbers in such a way that they only have a decimal value of 0 or 5. For example 1 -> 1 1.1 -> 1.5 1.4 -> 1.5 1.5 -> 1.5 1.6 -> 2 2 -> 2 Someone knows a simple…
-
4
votes1
answer50
viewsWhy is the default for an access modifier "protected" in . NET?
Unless I’m mistaken, the default when no class modifier is defined, for example, is assumed to be the protected: class LoremIpsum { ... } Is there any special reason for this? Which?…
.netasked 10 years, 4 months ago Andre Figueiredo 5,030 -
4
votes1
answer161
viewsInheritance with interface
How could I solve the following problem. Setting: I have a class B that inherits from class A and implements interface I. Problem: The I interface requires the implementation of the X method which…
-
4
votes1
answer148
viewsReflection Emit, what’s the point?
Passing a code to MVC, I saw there was a Label label= new Label(); that was underlined with red, when clicking to see the suggestions, I saw the following: using System.Web.Ui.WebControls using…
-
4
votes4
answers313
viewsChanging a random string of characters using Stringbuilder
I have the following variables:: String mascara = "12****3*59**100*"; String numero = "12345768" There is a way to replace the asterisks of my variable mask by the values of my variable number?…
-
4
votes2
answers839
viewsHow to check if a class implements a C#interface?
How to check if a class implements an interface? For example, I want to include an if that checks if an object is of the Idisposable type. How to do? I tried something like : MinhaClasse meuObjeto =…
-
4
votes2
answers801
viewsHow to change the value of a property given its name
In my program I have some classes where data is stored. For example Class1.alfa.dado = 66; Class1.beta.dado = 56; Class1.gama.dado = 37; The user will select in a Combobox one of the options you…
-
4
votes2
answers2764
viewsWindows Forms Start with Operating System
How do I make the user have the option to choose whether the system (system Tray c#) will start with the OS or not through installation in Wizardsetup (Visual Studio 2010)?
-
4
votes2
answers466
viewsMulti Banks / Cache / Client Layer
We are studying ways to develop some features for a system, which will be in C# . Net. I’d like to hear opinions on how we can do this, if we can use some frameworks or something else. Access to…
-
4
votes3
answers152
viewsViewdata error in controller
What could be wrong in this example? I can’t do it: var pessoa = new Pessoa ( PessoaId = 1, Nome = "teste teste", twitter = "@teste" ); Error message: 'Name' does not exist in the Current context…
-
4
votes1
answer77
viewsSense/NET: Installation and programmatic configuration
I am currently working on solutions that require the storage of files uploaded by users, associated with these files and making them available to other users and common maintenance tasks (clean-up,…
-
4
votes1
answer405
viewsCompare two date attributes in the database with two Textbox
How can I compare a range of two dates? data_Inicio date data_Fim date textbox_inicio textbox_fim I can do this on the ASP.NET side and the goal is that my start date will never be less than my end…
-
4
votes1
answer709
viewsHow to print the entire string if the length exceeds the page
I have to print one string which may vary in size. What I need is that if this string does not fit on the page the remaining text is printed on another. I know that for this I need to do something…
-
4
votes1
answer1801
viewsPicking specific amount of characters from a textbox
I am trying to get a specific amount of typed characters in a texbox, the current code is as follows: novaconfiguracao.CupomEstabelecimento = tb_NomeFantasia.Text.Substring(0,48).ToString(); In the…
-
4
votes1
answer1474
viewsScheduled tasks on the web
In Google Inbox allows the creation of reminders and allows you to postpone them to a certain date and time. The reminder is then taken from the main screen and when this exact date and time comes…
-
4
votes3
answers2598
viewsHow to know which component is in focus?
I am making a form (Windows Forms) in C# and I would like to know how to get the component that is focused. In my form there is a SplitterPanel and within it, in the Panel2, has a TabControl with…
-
4
votes2
answers808
viewsHow to use Filter in Folderbrowserdialog
I would like to know how do I put a filter on certain files using c#. Good is more or less like this, I am making an application in c# that should open some types of files ( in the case .frm ), in…
-
4
votes1
answer147
viewsHow to show the build version?
I see in some pages and systems the compilation version. I’d like to show in a view the compilation version of my ASP.NET MVC project.
-
4
votes1
answer540
viewsHow to make Blur effect on button?
Is there any way to 'Blur' effect on an image button using C# (Windows Forms)? I know this is possible with WPF, but I have no way to change it now. If not possible, there is something that gives me…
-
4
votes1
answer107
viewsTwo different builds same source Visual Studio
I have a Solution with several projects. I need to create two "profiles" of builds different for two situations. This is possible? In build A I will show the menus X, Y and Z. In build B I will show…
-
4
votes2
answers509
viewsHow to read the width and height of a physical image file?
How to get the width and height of a physical image file?
-
4
votes3
answers2878
viewsWhat is the best way to verify the existence of a record in the database via application?
Today I use a method that sends a COUNT with the record id as a parameter for the database. There is a better, perhaps more performative way to do this?
-
4
votes2
answers105
viewsWrong date calculation
I have the following method: TimeSpan dt = dataFinal.Subtract(dataInicial); double anos = Math.Floor(dt.Days / 365.25); double meses = Math.Floor(((dt.Days - anos * 365.25) / 30)); return…
-
4
votes2
answers1303
viewsPicking up content within a string
I’ll have a list of string in the following format: PERSON’S NAME( (LOGIN), an example would be this: ZACKSON MOREIRA MORGAN (zackson.morgan) Soon, I would need to get just what would be inside the…
-
4
votes1
answer430
viewsHow do you find the term X in the Fibonacci sequence?
I have to do a C# program that gets a number X which will be the term of the sequence and print it on the screen.
-
4
votes1
answer178
viewsDelay in the first call WCF service
I am developing an application using WCF to distribute, everything is working smoothly, but there is a strange thing, whenever I use the service the first time it takes a lot,(almost a minute for a…
-
4
votes1
answer114
viewsHow to know if the solution has been modified?
I would like to make a code, which when it is executed, I would know if the solution has been changed and which project has been changed, but I do not know if there is a method to be used. Then I’d…
-
4
votes1
answer122
viewsWhy does Arrays implement Ienumerable but not Ienumerable<T>?
I was making a class that contains an Array of the class Episode: public Episode[] EpisodesList; Then I implemented the IEnumerable<T> in my class. And as expected, I implemented the method…
-
4
votes2
answers1140
viewsProtect ASP.NET source code (aspx)
I have a question regarding ASP.NET: In the case of PHP when an application is placed on the server means to put the source code of the same. In the case of ASP.NET, (specifically C# with pages in…
c# asp.net .net security-guard software-engineeringasked 9 years, 3 months ago Anderson Brunel Modolon 1,111 -
4
votes2
answers325
viewsKnow if the application has been completed by the task manager
There’s no way my app knows it’s being terminated by the task manager? If the user is going to finish my application by task manager, my application detects this completion and performs some tasks…
-
4
votes3
answers1923
viewsHow to fetch a file in all folders
How to create an application that does a full search in a folder or disk looking for a file who in the image I’ve tried to use Directory.GetFiles and Directory.GetDirectory But when it gets to a…
-
4
votes2
answers121
viewsSoftware Release by Customers
The system I develop has several clients who use it. But I have a problem which is this: if I release a new version of the system, I raise it to the ftp, all customers using it have access to this…
-
4
votes2
answers445
viewsUpdate Text linked to a Databinding
I have the following property linked to a label, where the value of this property appears in the text field. Like this: this.labelPedidosHoje.DataBindings.Add("Text", pedidosIntegrados,…
-
4
votes2
answers523
viewsHow to create progress bar for uploading file via Google Drive API
I am sending file to Google Drive by their API. The request.Upload(); is lingering with no return. How do I make progress? It can be with a for even without a graphical user interface. Shipping…
-
4
votes1
answer81
viewsController and action routes in lower case
How to make the routes of controllers and actions are all in lower case? For example: instead of Noticias/Details stick around noticias/details.…
-
4
votes1
answer609
viewsInstall SQL Server with the application
I am finishing an application and will compile using Inno Setup. The system is using SQL Server. I’ll install the system on other computers. The database is installed on the computers that will…
-
4
votes1
answer3333
viewsError while consuming Web API
Hello, in an ASP.NET MVC web project I am trying to consume an API that is a Web API project, the two applications are running on the same server. When I access the MVC application error occurs when…
-
4
votes2
answers1229
viewsImprove code performance in C#
I’m doing some tests with some C# codes and during an analysis I realized that some high-peak problems happen when integer value conversions occur to string, in the vast majority the conversion…