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
answer159
viewsImprove the performance of a pointer method
Here’s the code working: string string_pick(string text, string tag, char caractere) { int index = text.IndexOf(tag); return text.Substring(index + tag.Length, text.IndexOf(caractere, index +…
-
-4
votes1
answer1085
viewsWhat is the difference between class instance variables, automatic (local) and static duration variables?
What is the difference between these variable types? How to identify them? How does C# work with them?
-
-4
votes1
answer320
viewsDoubt about using a model in the view
I have an entity called Request. I created in the Model folder a class that loads Orders, called Getpedidos. Well, when creating the controller, I added a view to Action Index. When I built the…
-
-4
votes2
answers546
viewsPublish my system to IIS and it is not loading multiple files
I published my system on IIS (locally) and when I access it, it does not load a range of required application files. I believe I published it correctly, but I’m not getting around to solving this…
-
-4
votes1
answer92
viewsIf allows you to execute other unwanted lines
I want to make a program that allows you to manipulate and manage information about Cds that are stored in a text file. The file must save for each CD, the name of the author/group, CD name, year of…
-
-4
votes1
answer62
viewsHow to synchronize full screen and minimized c#
Hello! How do I get an idea of the Design of Windows Forms in Visual Studio for different screens? position the right buttons and etc... Java made Forms have this automatic function, but in VS I…
c#asked 6 years, 4 months ago Igor Souza 45 -
-4
votes1
answer34
viewsHow to get the Membernames property with the index?
I started programming in C# a little while ago and I’m doing a validation treatment using Data Annotation with windows Forms, I have a problem that I can’t get the Membernames property from the…
-
-4
votes3
answers1367
viewsPlacing spaces between letters of a text
As if a certain string as "Something" was with spaces between the letters as for example "A l g u m a C o i s a"; as I do it in C#?
-
-4
votes1
answer76
viewsHow to use regular expressions?
I have a string with this value: Romania","PROXY_IP":"93.118.243.19","PROXY_LAST_UPDATE Indonesia","PROXY_IP":"117.102.88.121","PROXY_LAST_UPDATE…
-
-4
votes1
answer82
viewsPull a C# form in VB
Pull a C# form in VB Good I wanted to know how I could ta pulling a form in C# via Visual basic example:…
-
-4
votes2
answers281
viewsWhat is the correct syntax to use C# object orientation using . NET Core?
I have to familiarize myself with the implementation of object-oriented code in C#development. However, the materials I’m learning assume that I have Windows environment and Visual Studio installed…
-
-4
votes1
answer32
viewsI’m trying to move files zeroed (no content 0kb), I need help!
By pressing the button I need to move all zeroed files from one directory to another. My code. private void button1_Click(object sender, EventArgs e) { var pasta = (@"C:\Users\Desktop\Nova pasta\");…
-
-4
votes0
answers15
viewsExcel to real-time database with C#
Is it possible to take the data from an Excel spreadsheet (which is updated every second) and save the information every second in a database? The worksheet should be kept open at all times for the…
-
-4
votes3
answers79
viewsWhat would the conversion of this algorithm look like from c to c#?
How can I convert this algorithm from c to c#? int main () { char nome[50]; float LIM=20, soma=0.0, media, mediaTurma; float a, b, c, d, e, f, g, h, i, j; int x, y; for (x=0; x<=LIM;x++){…
-
-4
votes1
answer763
viewsLogging in via C#
I am developing a C# application and I need to do the following: I need to initially log into a site on a specific page. However it is necessary to log in, not just put the direct link from the…
-
-4
votes1
answer1815
viewsA view using two MVC models
Good afternoon, everyone, I have an MVC application and I need a view to access two models. The models are: And each model has its controller, where I connect to Webservice to bring the data from…
c#asked 6 years, 9 months ago Emanuele Baron 11 -
-4
votes1
answer27
viewsHello, I was trying to build a Textbox name from a string. Textbox+index
private void btnGravarNovosValores_Click_1(object sender, EventArgs e) { string descricao; string textBoxX; int i = 0; foreach (Object texto in lstTabelaProdutosPreco.Items) { descricao =…
c#asked 6 years, 8 months ago user9426886 21 -
-4
votes1
answer50
viewsWhy Class Object is null?
I don’t understand why but the player object is null , I’m not calling it right ? public class HealthBar : MonoBehaviour { Vector3 localScale; public Transform HealthTransform; public Player…
c#asked 6 years, 4 months ago Emanuel Sobreiro 105 -
-4
votes1
answer91
viewsdesectuate Json object
Guys I’m not getting to realize this object, public class itensjsonPai { public string resource { get; set; } public List<transaction> transaction { get; set; } } public class itensjsonfilho {…
-
-4
votes1
answer82
viewsMap Api port to MVC project
I created an MVC project and an API. I need to get the API when I upload the project to (F5). Example, I created a service that is a GET in my Type table. How I can map the API to get inside a MVC…
-
-4
votes1
answer51
viewsCart quantity
Good afternoon, I would like to know how I can take the amount I enter in my cart view and save it even giving refresh.. For example: customer added 8 amounts of pasta but after page refresh that…
c#asked 6 years, 1 month ago Bruno Reis 1 -
-4
votes1
answer59
viewsbutton to add a minute
Hello I have this code and I’d like to do a boot to add a minute to the time that’s running. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using…
-
-4
votes3
answers748
viewsURI 1021 gives 5% error
Read a floating point value to two decimal places. This value represents a monetary value. Then calculate the fewest possible banknotes and coins in which the value can be broken down. The banknotes…
-
-4
votes2
answers93
viewsV9 - Convert from VB to C# Import Accounting Records
Good morning, I’m trying to convert a program I did from VB to c#. I’m having a hard time with the headline. In Vb is simple. Dim Doc As New CblBEDocumento Dim Mov As CblBELinhaDocGeral Doc.Ano =…
-
-4
votes1
answer75
viewsReplace chunk of code C#
Guys, I have a question that I think you guys are gonna figure out. I have a login form of this with the following condition: private void button1_Click(object sender, EventArgs e) { if…
-
-4
votes1
answer39
viewsI’m having doubts on how to use the "{" keys
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MOVIMENTO : MonoBehaviour { private float spd = 0.9f; private GameObject camera; private GameObject…
-
-4
votes1
answer496
viewsOmnisharp does not start (Visual Studio)
OUTPUT of vscode: Starting OmniSharp server at 24/06/2020 21:52:56 Target: c:\Users\Wagner\Desktop\Nova pasta\Xistilishy\Xistilishy\Xistilishy.sln OmniSharp server started. Path:…
-
-4
votes1
answer123
viewsThe name "Json" does not exist in the current context
Good afternoon, I have the following part of my class that would serve to feed the objects obtained through a json online. public JsonResult GetJson() { string res; WebClient client = new…
-
-4
votes0
answers52
viewsHow to insert multiple rows into a sql server, keeping all these rows in the same id
I am studying a program that lends equipment, in its proper functioning, when making a loan of material should be kept in the dbo.emprestimo all loan details (name, location, business, etc), then…
-
-5
votes2
answers420
viewsHow to extend Pocos from the Entity Framework by encapsulating business rules?
I’m developing a three-layer system. My initial intention was to expose the business layer entities to be used in the repository (EF code first). I want to do this so that I can persist (in memory)…
-
-5
votes1
answer189
viewsc# how to make an attack ping the ip of a computer
Hello everyone I needed to know how can I ping an ip using winforms someone can help me is someone stole the Steam account from a friend?
-
-5
votes1
answer145
viewsInterop.word service
Good afternoon, I am using microsoft.office.Interop.word to convert word documents into pdf in WCF, however the interface simply to work WCF is online only the interface does not work, where it is…
-
-5
votes1
answer37
viewsWhat are the means of connections a C# application can have with SQL Server?
I would like to know what types of connections a given application developed in C# can have with the SQL Server database. Among all, which is the most efficient?
-
-5
votes2
answers239
viewsGroup items within a foreach
I have an object that brings me a basket with several items. I need inside a foreach to group the items by nature of operation. How I do this? It’ll be something like this: Prod: 2345 Nat. Oper:…
-
-5
votes1
answer237
viewsSubstring after character C#
Good Afternoon string nr = ABC:1 I’d like to take the number after ":" as I would? nr = nr.substring(...); Expected result: for nr = ABC:50 nr = 50; for nr = LKfasEWF:5039 nr = 5039…
-
-5
votes2
answers558
viewsHow to deserialize a json to int?
I have a test json to see if my implementation worked in my code: string json = @"{'ItemHome':[{'Texto':'111','Icone':'aaaa','Color':'aaaa'}, {'Texto':'111','Icone':'aaaa','Color':'aaaa'},…
-
-5
votes1
answer51
viewsHow and how best to calculate a net value
These days I’ve come across a problem I can’t solve and I don’t know much where it starts. I have these 4 fields on my system, where, if the user infoma the discount in percentage, the system…
-
-5
votes1
answer84
viewsHow to bring a city relationship into operation?
I have this model public class Funcionario { [Key] public int id { get; set; } [Required(ErrorMessage ="Nome do funcionário é obrigatório", AllowEmptyStrings =false)] [Display(Name ="Nome")] public…
-
-5
votes2
answers204
viewsHow to save an array of chars in a variable?
I’m doing an encryption program, starting to reverse the string with the following code: namespace APS { class Program { public static void Main(string[] args) { string frase;…
-
-5
votes1
answer579
viewsHOW TO CALCULATE INSIDE A CLASS? C#
I’m doing the following program on C#: Create an abstract class named "Combinatorial Analysis", responsible for specifying, in addition to the factorial calculation of a number, the methods due to…
c#asked 6 years, 1 month ago david gomez souza 43 -
-5
votes1
answer401
viewsDrawing Program
Guys I’m having trouble solving this problem, could someone help me? The problem of study is this: In a small country on the planet Cyber, the current currency is B$. This currency has banknotes of…
c#asked 5 years, 11 months ago Igor Pompeo 37 -
-5
votes1
answer97
viewsInvoice creation problem when using Github project
After implementing the aforementioned amendments, I was able to solve the problems of the remaining fields but a new problem arose. After modifying the code for the following... private static…
-
-5
votes1
answer33
viewsProblem with CPF validation
@model Projeto1.Models.Cliente @{ ViewBag.Title = "Create"; } <h2>Criar Novo Cliente</h2> @using…
-
-6
votes1
answer881
viewsTurn a string into json
I need to mount this json from a string and pass as parameter: I did that: string s = "{\"Matriz\":12, \"Filial\":21}"; At the click of my button I have this: private void Click_Service(object…
-
-6
votes1
answer98
viewsAutomatically add items from an array
I have those values: x = 5; long[] b = new long[]{5,1,2,3}; I need to make a program that adds the array items b so that the result is always 5(x). You can repeat items, like: [1,1,1,1,1] or [5] or…
-
-7
votes1
answer1161
viewsHow to script C# to run HTML
I developed a C#(Csharp) script for web pages! But I don’t remember how to add the script tag being the C# language and not javascript.
-
-7
votes1
answer153
viewsBook tip for those who stopped in time
Hello, I scheduled until mid-2012, I stopped then and I intend to return to my studies, but a lot has changed. My main area was the web, using php 5.3 , html 4 , css 2 and javascript with jQuery.…
-
-7
votes1
answer166
viewsEdit MVC . NET error
I have an error when I edit my registration, my Physical Model is like PartialView,the following error occurs: Attaching an entity of type 'Projeto.Models.Fisica' failed because another entity of…
-
-9
votes2
answers440
viewsObject orientation is the part of c# used for games?
That there are differences between the c# language for form programming and for other areas, I know, but I have a question: Is the object orientation the part used for game programming? If not: What…