Most voted "c#" questions
This tag should be used when the question refers to some resource, information or problem related to the C#language. C# ("C Sharp") is a multi-paradigm programming language that has strongly typed variables, is imperative, declarative, functional, generic, object-oriented and component-oriented, which are designed to be executed in . NET Framework.
Learn more…13,899 questions
Sort by count of
-
4
votes1
answer1208
viewsHow to print a View to a standard printer using Javascript or c#?
I need to print the contents of a view on the default printer. How can I do this using c# or javascript?
-
4
votes1
answer1098
viewsSearch in Datagridview populated by typing on it
I own a DataGridView already with recovered data where user selects an item. But, as the items are numerous, I would like to enable the user to type on the Datagrid while the system "goes" to the…
c#asked 9 years, 6 months ago Cassio Milanelo 791 -
4
votes2
answers151
viewsHow to get IIS information via c#?
How to get c# some IIS information like Version and some settings like Roles and Services. *Note: My application is not Web.
-
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
votes2
answers1532
viewsSend request get and receive data
According to Pagseguro, I need to do a GET and then receive the data that comes in XML format Documentation. I’m caught up in that part: To consult a transaction notification, you must make a…
-
4
votes1
answer1252
viewsWhat is Handled for C#
I saw in some codes the use of Handled being assigned as true and false of Combobox event arguments - Selectionchanged, Textbox - Lostfocus, Button - Click. I wonder what it’s for and what it…
c#asked 9 years, 6 months ago Mauricio Ferraz 2,074 -
4
votes1
answer4024
viewsSet the selected value in a Selectlist (Dropdownlist)
I have a list of vehicle models: private List<ModeloRastreador> modelo = new List<ModeloRastreador>(); add the result that came from the bank foreach (var m in modelo) {…
-
4
votes2
answers943
viewsCapture SOAP request
I would like to log all Soap requests exactly as they arrived on my server. There is a way this can be done via c#?
-
4
votes1
answer487
viewsHow to use escape characters in a string in C#?
I am unable to scan a file that contains the EICAR (Standard Test File for Antivirus Scanning Methods) characters, as it contains escape characters such as " ", "()", "[]". I need a help to identify…
-
4
votes1
answer101
viewsIsmouseover does not work
I have a boot in WPF and changed the style when passing the mouse on top (Ismouseover), but the problem is that not every time I move the mouse on top it changes style. When step the mouse very fast…
-
4
votes1
answer357
viewsHow to force login after running the application?
My scenario is this:: After authentication with Active Directory, the user who logged in is saved to a Session [HttpPost] public ActionResult Login(LoginModel model, string returnUrl) { if…
-
4
votes1
answer391
viewsHow to return concrete classes, with populated navigation properties, through Linq queries?
Following that question: Query by Linq and Lambda getting range of options by sub-query. How to get a result closer to simple? where, however, my model grew to one more class (resulting in another…
-
4
votes2
answers268
viewsQuery by Linq and Lambda getting options range by sub-query. How to get a result closer to simple?
Given the following classes: Menuraiz: public class MenuRaiz { public MenuRaiz() { Menus = new List<Menu>(); } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; set;…
c# entity-framework linq entity-framework-6 lambda-expressionsasked 9 years, 11 months ago user8052 -
4
votes2
answers3387
viewsFinish a process programmatically
I want to make a program that presents a Task Manager user. I already have the rest of the logic, but how can I finish a process (task Kill) with C#?
c#asked 9 years, 5 months ago Vinicius Marcel Conceição 41 -
4
votes1
answer587
viewsHow to communicate a local application with an open web page in the browser?
I have a commercial web application that runs basic restaurant operations. In summary, a waiter accesses the 'orders' page and requests a new 'product'. These products are classified by departments,…
-
4
votes1
answer139
viewsConvert an XML file to BSON
I have a Complex Xml that contains "children" nodes and I need to convert it to BSON. I’m using VS 2013 (C#).
-
4
votes2
answers7228
viewsHow to remove spaces at the beginning and end of a string?
How to remove any number of spaces at the beginning or end of a C string#?
-
4
votes1
answer446
viewsEncrypt XML with TJMG Public Key
I need to encrypt this XML <?xml version="1.0" encoding="utf-8"?><Selos>…
-
4
votes5
answers758
viewsHow to embed CSS in HTML tags?
I have a CSS file containing the following code. .texto{ Color: Red; } I have the HTML file with these tags: <html> <body> <span class="texto">TEXTO 1<span> <span…
-
4
votes2
answers1320
viewsSave user and password without database use
I am developing an application in C# of the kind Console, and I’m looking to save some sensitive settings like user, password and IP. The problem is, how to safely store this data locally without…
-
4
votes1
answer275
viewsWhy use the Ienumerable?
I have the following code in a Controller: var carro = new List<SelectListItem> { new SelectListItem {Text = "Pegeout", Value = "Pegeout"}, new SelectListItem {Text = "Chevrolet", Value =…
-
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
answer1334
viewsHow to read all bytes of a file
I have a question in Readbytes(int) My code is like this: BinaryReader r = new BinaryReader (File.OpenRead(ARQUIVO)); byte[] arraybyte = r.ReadBytes(100000); That one 100000 which I put is because I…
-
4
votes1
answer4562
viewsHow to exit a method before ending in c#
What should I do to stop the execution of a method before it ends, get out and continue the execution? public void MEUMETODO() { ... PARA E SAIR AQUI(); ... }…
-
4
votes1
answer162
viewsList non-visual component
I have tried several means to list all the non-visual components of a form, such as: OpenDialog, ImageList, TableAdapters and etc. but without success. To find the controls on the screen, I managed…
-
4
votes1
answer98
viewsMVC 5 template or other: initial user form, information, database
Templates that come in VS2013 or any other version, when starting a project, it mounts a menu with: Home, About, Contact, Register and Login. Question: How does it store information from the default…
-
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
votes1
answer288
viewsC# to Javascript Converter: ((object)Sender). attribute
I’m developing a C# to Javascript converter and I’m in a jam when the code has a line of code like this: ((CONTROLE)sender).Atributo Exemplo:((ImageButton)sender).ImageUrl What is the corresponding…
-
4
votes3
answers673
viewsFunctions with Textbox and Buttons type parameters
I have a program that at some point works with the visibility of an object. I’m creating a function and I don’t know how to reference objects. private void Visible(object x, object y, object z,…
c#asked 9 years, 4 months ago Yuri Ancelmo 353 -
4
votes1
answer870
viewsWhat is Array.Getlength for?
To know the size of a vector, I can only use the nomedovetor.Length, right? I saw an example in a structure for, where they wore GetLength(0) or GetLength(1) to capture the dimensions of a array row…
-
4
votes2
answers879
viewsCreate a routine within an Asp net application in c#
I have to run a method on my project ASP.Net, made a screen for me to select a Excel and a method for handling and insertions in the bank, only that this method will have to be run daily, someone…
-
4
votes2
answers622
viewsComponent for HTML text formatting
I am looking for a component where the user can type the desired text and do the formatting of the text as well as understand. Something like that from ONLY or the image below. Does anyone know any?…
-
4
votes2
answers940
viewsDoubt how to call several different images
I’m a beginner in C#, I’m using visual studio 2010 and I have a project to do and an idea came up, but I don’t know how to put it in code. I would like to put 2 combo box ( ITEM and COLOR ), and an…
-
4
votes2
answers339
viewsTrade foreach for for
I need to change the following foreach() by a for(). The problem is that instead of arrays the loop runs through a dictionary. This is the code I want to transform for(): foreach (var joint in…
-
4
votes1
answer175
viewsWhat is the difference between the declaration forms of Generics with out and in?
What is the difference between Generics statements when using out and in? Example: public class GenericClass<T> { } public class GenericClassOut<out T> { } public class…
-
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
answer892
viewsAjax request
I am loading the menu, from the system I am developing, through a request via ajax using jQuery, but the formatting of the menu is not as expected. My request via jQuery <script…
-
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
votes1
answer897
viewsObtain image data
My system should process some images and get key data in text. Of course, the images will follow a style pattern. Where can I start? Is there an API that can help me?
-
4
votes2
answers516
viewsShould the Domain layer depend on Infrastructure?
I’m reading Evans' book on D.O.D., and I came across the following quote:: The Infra layer does not perform any action on the domain layer, because it is below it, because it is below it it should…
-
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
votes2
answers2245
viewsHow to capture Alert message using web browser controler?
I am developing a robot using the web browser controler of Asp.Net C#. In this robot I need to identify some messages that appear in Javascript Alert. The site that the Robot is manipulating is not…
-
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
votes1
answer127
viewsBest practices when using Sqlcommand? Text or Storedprocedure?
I’m wondering which of the following approaches is best? 1 - Add a file *.sql as Resource, then run the Sqlcommand with the CommandType.Text. 2 - Add a Store Procedure to the Database, then run the…
-
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
answer201
viewsPick up selected Radiobuttons in WPF
I have several radiobuttons on my form, each with a content different. How do I catch the radiobuttom selected? Without having to do a método to check one by one.…
-
4
votes1
answer957
viewsHow to save text in XML or txt or HTML file?
I am developing a program in C# and would like to know how to save the text of a RichTextBox format .xml or .html or .txt.