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
-
0
votes2
answers2296
viewsRead multiple lines from a file in parallel with c#
I have a file with almost 700mb that has numerous lines with Json within it. I need to treat every json line-by-line and insert them into my database. The point is, today I’m using the following…
-
0
votes0
answers794
viewsComputer screen stream with C#
I’m having a problem with streaming the computer screen with C#, I’ve done the software where the server would create a TCP socket and the client would send a print of it in Bitmap form. But the…
-
0
votes1
answer401
viewsNhibernate create database?
I am a Java developer and work with Hibernate. Now I need to create a desktop application and decided to use C# for this. I’ve been researching ORM frameworks for C# and found Entity Framework and…
-
0
votes1
answer839
viewsError when reassembling a string. Size is out
I can’t fill out that list the way it is: foreach (var item in text) { string[] linha = item.Split('\n'); foreach (var i in linha) { string nova_string = i.Substring(0, i.LastIndexOf("\r"));…
-
0
votes1
answer24
viewsCreate key with more than one file and delete everything at once
Can I create in the app.config a key pointing to multiple directories and the code pointing to that key and deleting all directories at once? Should each directory be separated by ";"? Type like…
-
0
votes1
answer2189
viewsHow to fix System.Collections.Generic.Ienumerable error
My application that manages Courses is making that mistake O item de modelo passado para o dicionário é do tipo 'System.Collections.Generic.List'1 [MeuProjeto.Models.Curso] ", mas este dicionário…
-
0
votes1
answer163
viewsUse of except in a lambda expression
I have that expression and it doesn’t work: var busca = listaCommiter.Where(l => l.Except(listaFarm.ToString())); I’ve already removed Tostring() and still nothing. listaCommiter and listaFarm…
-
0
votes1
answer82
viewsHow can I interact with a class that is behind two?
Good night! I will explain the problem since the title is not suggestive of it. I have to develop an online shopping system, able to manage the purchases of each user. If you think about it,…
-
0
votes1
answer3397
viewsResize elements according to form size
I have a GroupBox within a Form which has the following pattern: Padrão de tela - Form: 1290;700 - GroupBox Principal: 1260;600 That one Form is opened through MDI. I use a function to center this…
-
0
votes1
answer37
viewsI do not know the feasibility of doing in lambda or Linq my expression
I have these two lists: List<string> dirZipDireto = ConfigurationManager.AppSettings["Dir_Zip_Direto"].Split(';').ToList(); List<string> arquivos = Directory.GetFiles(caminhoCommiter,…
-
0
votes0
answers35
viewsCondition for running alarms on Windows Phone 8.0
When creating an alarm for Windows Phone 8.0 using the following code: Alarm alarm = new Alarm(nome) { BeginTime = dateValue, ExpirationTime = dateValue2, Content = "Horário!!!", RecurrenceType =…
-
0
votes3
answers3672
viewsRelease other Amazon HTTP ports
Hello, I am setting up a server on Amazon where I would like to have multiple sites in the same instance. I set up on the IIS server each site on a port, but the Amazon firewall only allows me to…
-
0
votes1
answer1496
views -
0
votes1
answer114
viewsFormat query to send to Viewbag
I did a query in Latin, but the result was not as expected, it seems simple the problem but I can not solve. Result on the label: { Year = 2016/2017 } Expected result on label: 2016/2017 Controller:…
-
0
votes0
answers46
viewsOnly get a snippet of the string in C#
I tried by substring unsuccessfully, get only the text after the second ":". :##########!#######@############### PRIVMSG #barbosza :ds For security reasons I hid some characters with #.…
c#asked 8 years, 8 months ago Marcos Barbosa 377 -
0
votes2
answers1509
viewsOrder queue in c#
Since I already have this code: Queue<string> Fila = new Queue<string>(); //Declaração da Fila string opcao = "1"; //Define opção como 1 while (opcao == "1") //Enquanto ele quiser…
-
0
votes1
answer569
viewsMultiple modal bootstrap always returning the same content
I’m developing an Asp.net mvc application, on one of the pages of the site I call several bootstrap modals over each other, however, when you already have an open modal the new appears with the same…
-
0
votes1
answer99
viewsCollection of objects c#
Galera need to fill a list that is inside another list, but is giving error. Follows the code: Promotora = new LojaPromotoraInfo { CodGerente = DBUtil.GetValor<string>(oRow, "CodGerente"),…
-
0
votes1
answer97
viewsDisplay form in the middle of splitContainer Pinel?
I’m using the following code to call and show the form in the panel2 of my splitContainer: splitContainer.Panel2.Controls.Clear(); // limpa o painel2 form.TopLevel = false; // redefine lvl do form…
-
0
votes0
answers44
viewsInstancias Lentas C#
I am creating an instance of a certain class , and it is taking too long to instantiate . Does anyone know how to solve this ? Suddenly the applications took time to instantiate code of the class…
-
0
votes0
answers31
viewsWorking with values in C#?
I’m looking for the right way to work with values in C#. In Java I use Bigdecimal but in C# so I did not find anything similar. Some examples I found speak to use double or float or just decimal…
c#asked 8 years, 8 months ago FernandoPaiva 1,562 -
0
votes2
answers1247
viewsHow to implement a function to return the sum of squares in the proposed form?
I did not understand the proposal here. The whole question is in the Commoner, by the statement, I understand to be a delegate. See, they do not need to post codes, I would like only one way to…
-
0
votes1
answer282
viewsEntity mapping oneToMany with Fluent Nhibernate
Gentlemen, my problem apparently is simple, I must be doing or forgetting something and I just can’t see the error. Can you help me? I have the class Cliente: public class Cliente { public Cliente…
-
0
votes1
answer77
viewsHow to override a class from an external project to call a function
I have a solution where contains 2 projects. One of them is the project I pulled from github, so I don’t want to modify it because every time I upgrade I will lose my settings. In this project there…
-
0
votes1
answer84
viewsProblem with foreach Shopping Cart
I’m having a problem with foreach and I wonder if there’s another method to not have to change all the code. What happens is that each time more than one product is added to the cart, if we buy for…
-
0
votes0
answers61
viewsHow to add bytes to a byte array?
Boas. How do I add one byte[] to another byte[]? Byte1.add(byte2); Giving more code will not help in understanding the problem. But I will explain better. I have a byte[] called fullbytecoll[] that…
-
0
votes1
answer52
viewsPerform 'Check' of a Datatable (Ids) in batch in the database
I have a small desktop application (Windows Forms - .NET 2.0 - C#) in which I just use it to perform a check on a given time-to-time path and in case this check finds a file. txt in this path, an…
-
0
votes1
answer204
viewsProblem doing refresh of quantity shopping cart C#
By refreshing the quantity already in the shopping cart, I can only refresh the quantity of a product, if I have 2 products in the cart I can’t refresh one of them. Imagine that the 1st product has…
-
0
votes1
answer129
viewsHow to validate a blank maskedtextbox?
In case the maskedtextboxTEL (00)0000-0000 would return a error provider and would not proceed until it has been completed.
-
0
votes1
answer101
viewsMake a Textbox read a binary number. C#
Hello, I am making a program that simulates a ULA(programmable logic unit), and I need my textbox to read the value written in binary. For example: In Textbox1 the user would write 1010(decimal…
-
0
votes0
answers61
viewsHow to write a string in an image or PDF?
Having a template image or a PDF file with an image template embedded in it, the image could be a card for example, hence in the application have fields TextBox as "Name, CPF and Comment", hence…
-
0
votes0
answers113
viewsWPF XAML does not render
I’m having trouble with the view only renders normally when I insert the Resourcedictionary in the Resources of the same, but when I insert the Resourcedictionary in the App.xaml Resources the view…
-
0
votes2
answers119
viewsRender View for a string
I took a code right here in the stack to render a view to string. When the view to be converted is in the same context, that is, in the same controller folder works normally, however if I try to…
-
0
votes1
answer698
viewsProblem changing texture of a gameobject in Unity
I’m doing a job in Unity where the goal is to detect facial expressions with Kinect. In Unity the default expression is "neutral" and depending on we change expression to "smiling" or…
-
0
votes1
answer109
viewsHeranca de Proprieade Usercontrol Para Form VB.NET
How do I make a form inherit the same properties as a user control by dragging it from the controlbox to the form? Example: I created a Usercontrol with FormBorderStyle = none, I compiled and…
-
0
votes2
answers918
viewsTurn Stream into Byte Array
Good!! I have a ZIP file stream with a size of approx. 450 Mb, and I need to convert it to an array of bytes. For this, the Memorystream (System.IO.Memorystream) is used by default, following the…
-
0
votes0
answers112
viewsOrganize Listview by column
I have a Listview with 2 columns : Model | Variants . By clicking on the top I want the table organized according to the column I click
-
0
votes1
answer401
viewsDynamically add Checkbox
I have a project where by clicking a button I intend to pick up the text of 3 TextBox and add them to a CheckBox. So far so good, the problem arises when I want to add these CheckBox automatic, for…
-
0
votes0
answers162
viewsNamespace
I installed system.web.helpers and now I need to install system.web.mvc. It turns out that both have a dependency called: system.web.webpages and therefore the installation of mvc is giving error.…
-
0
votes1
answer1909
viewsAsp.NET + Pagseguro
Good morning, I arrived at the moment you need to add the forms of payment. and I want to put Pagseguro. What’s the first step to doing this? Where do I have to implement the pagseguro classes in my…
-
0
votes1
answer1398
viewsCheck that the file has been copied
I have the following situation. A file is placed in a certain directory, when it is copied need to move it to another folder. How do I check if you have finished pasting this file to be moved after.…
c#asked 8 years, 7 months ago Paulo Henrique 379 -
0
votes0
answers74
viewsCount values in a Msaccess table
I am creating my first application and would like to know how count values of a table in Msaccess with the following conditions: "requester" and "Status" must contain specific values; If it contains…
-
0
votes2
answers229
viewsGet elapsed time from a string
I wanted to calculate the time now with what I get from a string like this: 2016-04-16T15:55:53Z But the time is three hours longer than our time zone, wanted some kind of exit: Já se decorreu 0…
-
0
votes1
answer488
viewsExtract . zip file
I have a file that is zipped by the 7-Zip, at the time of unzipping by the c#, using the following code: try { ZipFile.ExtractToDirectory(caminho + "\\" + arquivo, arquivo); } catch (Exception e) {…
c#asked 8 years, 7 months ago Paulo Henrique 379 -
0
votes1
answer345
viewsDrawing of predefined values
I have two Textbox (txtUM, txtDois), and would like to draw some pre-programmed date/string (Between dates: 07:55, 07:56, 07:57, 07:58, 07:59, 08:00, 08:01, 08:02, 08:03, 08:04, 08:05 ). The number…
-
0
votes1
answer658
viewsLocal Application to Save C#Data
I’m in need of working with Windows Forms, more specifically in a system that works on intranet, without the possibility of using MYSQL, SQL Server among others. I need to create a second project…
-
0
votes1
answer188
viewsWhat good is Runnable?
I was thinking of creating thread one in my software, but I saw through the forums that the Runnable help in a certain way in creating a thread, and wanted to understand how it works.…
-
0
votes1
answer140
viewsWYSIWYG editor with code style
I am creating a website where I will post some code snippets (as if it were a backup of my codes), and for this, I am using ASP.NET MVC. Almost everything is ready, what is missing is a WYSIWYG…
-
0
votes0
answers112
views"Asp:Button" does not work inside "mmenu Nav"
I’m trying to integrate "jquery.mmenu" into a Visual Studio project. It seems that an "Asp:Button" does not work inside a "mmenu Nav". An "Asp:Linkbutton" also seems not to work at all. Take for…
-
0
votes2
answers866
viewsConvert date format to Mysql
I’m developing a software in C# and in this software I asked to inform the customer’s date of birth in the format dd/mm/aaaa, but in the database the date type is only accepted in the format…