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
-
-1
votes1
answer56
viewsc# How to Apply Function to validate Cpf in an API?
I need a help I have a CPF validation class in C# in a registration API project, but I don’t know how to implement this function to work validation, I’m using Microsoft to add the function in…
-
-1
votes1
answer60
viewsError when serializing JSON in C#, apparently the API returns different structures depending on the object’s completion
I’m having problems returning a third party API (I don’t have access to the code) that I’m consuming, more specifically in the section below: var result = client.SendAsync(request).Result; var…
-
-1
votes1
answer45
viewsC# How do I prevent composite name from saving more than one space?
This is my validation: [Required(ErrorMessage = "O nome completo é obrigatório.", AllowEmptyStrings = false)]…
-
-1
votes1
answer40
viewsCheck character by position in C#
Good evening, developing a program in C# for the first time, I’ve done this program in JS and now I’m learning C# and passing the program to him. I need to check character by character of a…
-
-1
votes1
answer34
viewsWhy does Arduino stop sending data?
The application (C# .Net Framework 4.7.2 in Visual Studio 2019) I’m doing sends a command to Arduino via serial and Arduino sends 'n' sensor data. However, the first time I run the program, nothing…
-
-1
votes0
answers11
viewsHow do I update with various c# records with Mongodb?
Personal I am doing my tcc and I am using Threads to simulate a simultaneous access of users in the database, already managed to do the implementation for mysql as in the example below, but I’m…
-
-1
votes1
answer33
viewsHow to use in a string that contains double quotes in its contents along with the @marker
I am creating a simple unit test that compares two strings and would like to use the marker @ to leave the contents of a string formatted in several lines as follows: var esperado =…
-
-1
votes0
answers37
viewsHow to encrypt String in C# and decrypt in Java
I am working on an embedded system where messages are encrypted with C# and need to be decrypted in a system made in Java. Code in C#: public static string Encrypt(string input) { byte[]…
-
-1
votes0
answers12
viewsSfdatagrid Bhutan with Double Click
I have this Remove Item Button, only it only triggers after two Clicks, but I would like to remove the item on the first click. <Label VerticalAlignment="Center" FontSize="18"…
-
-1
votes0
answers12
viewsError using Updatepanel: "A control with the btnAbrirDoc identification was not found for the trigger in 'Updatepanel'
Follow the code below: <div class="row"> <div class="col-md-2"> <asp:Label ID="lblMsg" runat="server"></asp:Label> </div> </div> <div class="corpoFav">…
-
-1
votes0
answers10
viewsHow to write a new pdf every 4 pages of the main pdf c# Winforms
I have a pdf document with more than 1000 pages and want to separate it into different pdfs every 4 pages, how can I do this? public string ReadPdfFileForTreatment2(string fileName) { StringBuilder…
-
-1
votes0
answers14
viewsHow to disable the log of certain c# routes using iLogger?
I currently use Microsoft’s own Logger to log the application, as follows: if (environment != null && !environment.IsLocal() && !environment.IsDocker()) { return loggingBuilder…
-
-1
votes0
answers20
views -
-1
votes0
answers11
viewsCombine files by removing repetitions
In the following code snippet written in C# Asp.net core mvc, the application READ the.txt files and all their contents inside a specific folder, then stores the READ content in a new file (similar…
-
-1
votes0
answers15
viewsI’m having difficulty reading an XML file and modifying it
I am creating a routine that will automatically change host configuration files in C# However I’m not sure how to handle the file . config which is actually an xml: XML (file . config) <?xml…
-
-1
votes1
answer19
viewsHow to make a query using SELECT with conditions of LIKE '%' and Equal "=" with input of textbox and dropdowlist in C# ASP.NET
I am doing a query of people by filter, but I have come across the following problems: 1º LIKE Condition %%, (because the user will not always fill the fields "Document Number" and "Name" -…
-
-1
votes0
answers14
viewsUndefined object reference for an instance of an object. C# Httpcontext.Current.Session
Guys, I have the new system here of the company trying to run it on localhost, but when I log in it returns this message: Referência de objeto não definida para uma instância de um objeto. Here’s…
-
-1
votes0
answers19
viewsHow to Select Field from a Table in Microsoft SQL Server Management Studio (SSMS) through C#?
I am making a login system, and for the login to be valid, I must read the value entered in txtNome (where the user will have entered the name he registered), save the text in a variable and perform…
-
-2
votes1
answer70
viewsDoubt of licking on a guy
How do I make a lambda to bring only records that contain the word Transfer? For example, in my example, there are 19 records, but 3 are not Transfers, so it should come 16. Below my code and my…
-
-2
votes1
answer179
viewsCollection does not allow foreach
I have a collection and inside I have another collection of images. I need to do a chained foreach to get information from the first collection, and then the second foreach to get the images I have…
-
-2
votes1
answer579
viewsHow to read this text and separate the names of each person using Artificial Intelligence?
I have this text, I would like to read the names of each of the players. What would be the best way to read? Is there a tool/language or extension for C# that allows me to read this structure? Not a…
-
-2
votes1
answer82
viewsError message about something that does not exist in the application
While running my application is showing this message, but there is no such parameter. Here is the error message: <%@ Application Codebehind="Global.asax.cs"…
-
-2
votes4
answers2549
viewsHow can I automatically download PDF from a web page
Is there any way to download a PDF embed on a web page? I am currently using the control WebBrowser.ShowSaveAsDialog() (Save As) but need to do without it, automatically using C# Windows Forms My…
-
-2
votes1
answer85
viewsHas anyone ever used Admob on Windows Phone 8.1 Silverlight and it worked?
I have an app completed and I would like to publish, but I’m afraid of having to redo the project on Windows Phone 8.0 Silverlight. I am currently having trouble in admob where the emulator works…
-
-2
votes1
answer341
viewslambda expression gives conversion error
This is my lambda ring: public JsonResult CarregaDescricaoRede(string _tipo_rede, string _uf, string _cidade) { var resultado_rede_descricao = (from _pdv in db.PDV .Where(r => r.Tipo_PDV ==…
-
-2
votes2
answers711
viewsInstalling a Winforms C# application on the client
I developed an application in Winforms C# in 03 layers with Access.MDB Database: Now the questions so that the Application can be installed in the client and function properly. The files I send to…
-
-2
votes1
answer225
viewsError compiling: Error 4 Assembly [...] must contain a strong signature to be marked as a prerequisite
Error 4 Assembly '......' must contain a strong signature to be marked as a prerequisite.
-
-2
votes1
answer563
viewsHow to clear the query string after I already got the values I want?
I’m using Asp.net c#, and I wanted to clear the query string so it doesn’t look for the user, for example "http://meusite.com.br/Pagina1.aspx?parametro=Lucas"..... I take this name and use it in my…
-
-2
votes1
answer436
viewsHow to get the value of an Odata JSON object and convert to string?
After accessing the WCF, I get the following answer: { "odata.metadata": "http://luiz-note64/WcfOper/WcfOperDataService.svc/$metadata#Operacoes&$select=IdOperacao", "value": [ { "IdOperacao":…
-
-2
votes1
answer88
viewsSomebody help me something is wrong here there are 3 mistakes and I don’t know how to get them out! C#
using UnityEngine; public class PlayerMovement : MonoBehaviour { //Velocidade do Jogador public float speed = 6f; //Vetor responsavel pelo movimento Vector3 movement; //Responsavel pela transliçao…
-
-2
votes1
answer34
viewsc# cmd if writing something else shows a msg
Hello I would like to know how I could do on cmd so that when someone wrote anything other than Tree it appeared a msg to say "what you wrote" was not recognized...
-
-2
votes1
answer96
viewsHow to disable a window?
I am looking for some code that disables a window, and after the user enters a login and password in my form the window comes back to operate. Being more specific and with a little detail, I’ve seen…
-
-2
votes1
answer122
viewsC# - Start developing . Net
Having already some knowledge in php,javascript,html, css,responsive design framework ,such as, bootstrap and semantic-ui, and as my main focus (like) is to develop applications for the web, I would…
c#asked 8 years, 1 month ago Adriano Maia 301 -
-2
votes1
answer867
viewsReturn of Json
I still don’t understand how JSON works, but here I have a Controller code that returns a JSON and I want to know how to display this data on the screen. public ActionResult ShowPlaylists() { if…
-
-2
votes1
answer2341
viewsHow to pass a Controller object or object list to View?
Controller: [HttpPost] public ActionResult Create(Pedido pedido) { List<Produto> lista = new List<Produto>(); if (ModelState.IsValid) { Cliente cliente =…
-
-2
votes1
answer331
viewsSend email to different servers
I want my program, done in C# using a web service, to send an email every day with an attachment to some email addresses from different servers. I was watching a tutorial and I had a question. The…
-
-2
votes1
answer65
viewsUpdate warning screen
I am developing a stock control system and box front and I intend to create a warning screen in the main form (can be with datagridview), where, if when selling a product and the same reaches the…
-
-2
votes1
answer234
viewsEntity Framework does not edit FK
I’m having some difficulties with a big project, and I tried to make a very simple replica to post here so that someone can help me. One of the difficulties I’m having is how to edit the fields with…
-
-2
votes2
answers263
viewsPermissions according to groups of AD
Good people, as I mentioned in some questions I am developing a query Webapp that needs to have a login through the network using the users of Active Directory. My goal is that there is a group and…
-
-2
votes1
answer1045
viewsAssinar xml Nfse paulistana
I did a program in C# who signs the XML in batch of the legal note of Porto Alegre. Now the company in which I work opened a branch in São Paulo and I need to sign the XML batch of the São Paulo tax…
-
-2
votes1
answer54
viewsConnect with Mysql universal win 10
I would like some help as I would like to know how I can get information from a Mysql database and that will be taken over by a textblock. could help me with the code that does this? EX: In Database…
-
-2
votes2
answers90
viewsDoubt Gets/Sets
My project has 3 layers, DAL, BLL, Project utilizo ASP.NET I have an aspx page in the project, which has textbox containing new values for a database update. In the DAL class I have Entity that…
-
-2
votes2
answers124
viewsRemove half of the file name
I have a page to pick up a path, which is the Folder Browser Dialog and the path that is saved is like this : "C: ana Updates 2017 2017_04\" I wanted to go through the path, save only the result in…
-
-2
votes2
answers58
viewsFetch file in multiple folder from a base folder, except the folder
string[] arquivos = Directory.GetFiles(@"C:\Teste_Zip\web", "*", SearchOption.AllDirectories); The question is: I need to get the files except in a folder. I could not except the folder. The folder…
-
-2
votes1
answer114
viewsWhat are the reasons for migrating an application to a newer technology
I wonder what you think about that? What are the benefits? Thank you.
-
-2
votes1
answer104
viewsPush Notifications Ios
I would like to add push Notifications to my app, I would like someone to explain to me what this whole process would be like since the data enters a SQL Server database and my app receives this…
-
-2
votes1
answer3734
viewsWhich IDE to use for C#/C++?
Good people, I want to insert myself in the world of programming whose end users are Windows users. I already work with Java and have a notion of programming, only what I wanted to know is an IDE…
-
-2
votes2
answers513
viewsTostring("C3") error
I did this in the constructor of my class and now gives error saying that there is no overload for the Tostring method with 1 argument. It was working, I gave a clean in the Solution and it broke…
-
-2
votes2
answers485
viewsHow can I call a class void method to display an msg in a form
I have a method public void listarProduto(). It needs to have all the user input information. My problem is time to call this method within a MessageBox() in the form for the message to be…
-
-2
votes1
answer121
viewshow to fetch table values in C#
i have this following code, how do I return what is in the user field of the user table ? public int GetPerfilId(string username) { int result = 0; if(db != null) { DAL.Utilizador uti =…