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
-
2
votes2
answers756
viewsPossible SHA256 return 128bytes after signing?
I’m using the following code to get my certificate and sign my Cnpjs, but I’m using the SHA256 algorithm, but it’s returning 128bytes. Can anyone tell me what’s wrong? Follows the Code: Dim data =…
-
2
votes2
answers546
views -
2
votes3
answers4786
viewsLine break into email message
In my string mensagem, i would like to have a two line space, I tried using "/n" and I did not get the expected result. @{ var customerName = Request["customerName"]; var customerEmail =…
-
2
votes1
answer741
viewsManipulating Listview C#
I have a Listview that displays the data on the screen and has several rows and columns. For example: Cl1 | Cl2 | Cl3 L1 aa | bb | cc L2 ab | bc | cd L3 ac | bd | ce I wonder, if you have any c#…
-
2
votes1
answer557
viewsHow do I insert any file extension into an SQL database?
I always worked attaching only images in my BDD tables, I remember that converted to MemoryStream and then to Byte and inserted... But I need to insert any kind of file extension in my database.…
-
2
votes2
answers1914
viewsHow to make Insert in tables with many relationship for many?
I’m having second thoughts about how I’m gonna do the Insert relationship n:n my tables are: Recibo Analise Analise_Recibo (recibo_id, analise_id)…
-
2
votes0
answers186
viewsHow to use Hasmorepages on this occasion?
Well, I have a printing system here that is working perfectly. The problem I am facing is regarding the use of bool HasMorePages. I’m not sure how to implement it to print multiple pages if the…
-
2
votes1
answer309
viewsVS 2012 Bundles use or not use, that’s the question!
I’m starting in VS 2012 and between the changes appeared the bundles. I have some doubts: 1 - Is this approach worth using? Why? 2 - The bundles should even stay inside the tag ScriptManager 3 - I…
-
2
votes1
answer196
viewsConverting a. NET algorithm to JS
Fellas, I’m having a little problem converting an algorithm. In the algorithm in .net i have the following conditional structure: if (')' == caracter){ String item = pilha.Pop().ToString(); while…
-
2
votes1
answer275
viewsCheck the size of`Sessions` on the server
The following method is used in a web form application to store logged-in user information: public Usuario UsuarioLogado { get { if (Session["Usuario"] != null) return (Usuario)Session["Usuario"];…
-
2
votes2
answers2457
viewsSubtract dates and compare with value
I have two dates: DataAcesso and DataAtual of the kind DateTime. I have one more field called TempoAtualizacaoAutomatica typo byte. I need to subtract these dates and compare the result with…
-
2
votes2
answers230
viewsHow to verify if a file name has 16 digits?
namespace _06_Teste { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void cmdValidar_Click(object sender, EventArgs e) { foreach (String file in…
-
2
votes1
answer216
views -
2
votes2
answers931
viewsSelect returns nothing at all
I have the following method: public DataTable Select(bool all = true, string campos = null) { if (all && campos == null) _sql.Append("SELECT * FROM "); else _sql.Append("SELECT " + campos +…
-
2
votes3
answers226
viewsHow to use Getsetting/Savesetting in Windows Services
I created a service and configured it as Localsystem. In the implementation I try to search for a record saved on REGEDIT by another programme. The method GetSetting always returns me empty. Is…
-
2
votes1
answer91
viewsWhere can I find the Microsoft.WindowsMobile.Forms library?
I’m developing an application on Smart Device for Windows Mobile 6 in Visual Studio 2008 C#. In this application I need to use the object functions CameraCaptureDialog, because, the main goal of the…
-
2
votes1
answer570
viewsConversion of string to datetime with specific format
I have a string in the following format: 16Mar2009(mon), but I’m not getting to convert into datetime. string format = "dMMMyyyy(dd)"; DateTime dt = DateTime.ParseExact("16Mar2009(mon)",…
-
2
votes2
answers1201
viewsIdentify USB stick
I need the application to copy a file when a flash drive is connected. It has how to identify when the removable disk is connected and the volume name, so that the system does not copy to the flash…
-
2
votes1
answer641
viewsA little more about File.Writeallbytes
How to display progress by synchronizing the following function: File.WriteAllBytes(string path, byte[] content); This method should be called according to a System.Threading.Thread Ex: Thread wnd;…
-
2
votes1
answer235
viewsImplement Interfaces
I have the abstract class ClasseA and 2 child classes ClasseB and ClasseC, then I have an interface IClasse which is implemented in ClasseA and ClasseB. In the interface I have the method metodo1…
-
2
votes2
answers153
viewsAlternative to the use of new when implementing methods that return this in child classes
Taking the example of the following code: public class Pai { protected string PropriedadeA { get; set; } public Pai Metodo1(int valor) { //Vários procedimentos feitos aqui PropriedadeA = "Resultado…
-
2
votes1
answer779
viewsMultiple config files in different ASPNET MVC projects
I’m in trouble and maybe someone can help me. I’m working on a project ASPNET MVC so that I structured the solution in several projects to decompose the different components. In my main project…
-
2
votes1
answer1315
viewsError while exporting to Excel (Corrupted file)
I am making an application to export the result of a query sql for Excel. After the file created the time I will open it gives a corrupt file error. SaveFileDialog sfd = new SaveFileDialog();…
-
2
votes2
answers733
viewsFormat string in View
Is there any way to format a string (returned from a query) directly at View, to show the first uppercase letter and the rest lowercase? Ex: In C# I can use Textinfo.Totitlecase for that reason.…
-
2
votes1
answer3519
viewsHow do I show and select one of the digital certificates on my computer
In my desktop I have some certificates and I need to select one of them, I would like to know via VN.Net or C# code how to appear a list and I choose the digital certificate I need, without having…
-
2
votes2
answers439
viewsStore modified class properties
I need to have stored in the class itself a list with (name and value) of the changed properties. However, I don’t know if the form I am using is feasible. I have the class Employee below: public…
-
2
votes2
answers816
viewsConvert hexadecimal to integer
I have this hexadecimal value "E365A931A000000". I need to convert it to integer I’m using the following code. string hex = "E365A931A000000"; CodLibercao = Convert.ToInt32(hex); This code is…
-
2
votes2
answers94
viewsCatching the Location of a POST
I’m using the method HttpRequestHeader to make requests (GET and POST), but I need to take the parameter Location of the response of a POST and I am unable to evolve. There is an example of my…
-
2
votes2
answers80
viewsHow to ensure that the instantiation of a class is done only through "using"?
I am creating a DLL with some database features (ADO.Net). It would be very convenient to ensure that instantiation of connections is always used only via using (block), not to forget to call the…
-
2
votes1
answer529
viewsHow to concatenate properties of a single List<> with LINQ?
I need to concatenate two properties of each item on my list, in the example below it works but I would like to know how I can do the same thing using LINQ instead of foreach? public partial class…
-
2
votes2
answers949
viewsHow to know the current state of the form?
I am beginner in the area, I could not find my question elsewhere. Is there any code, which shows the state of the form? For example: if it is in focus, if it is minimized or maximized? Thanks in…
-
2
votes4
answers357
viewsObjectcache to provide a variable for all users
I have an application in ASP.NET and would like to cache for all users as if the variable was in pool application and everyone had access, something other than the session that makes the section…
-
2
votes1
answer276
viewsHow to style a WPF application to look like Windows 8 applications (Metro style)
I work in a company where they use a system that is very reminiscent of Windows 8, even though I am on Windows 7 machine. What I needed to do is to develop a desktop system on my computer (Windows…
-
2
votes1
answer1533
viewsCompiler error or code error?
I came across the following case and do not know if it is . NET error or error in my implementation, same syntax (see image below). condenacaoInsert.qtd_ano_pena = null;…
-
2
votes2
answers239
viewsDataset with cloister Where like '%' @parametro Visual Basic 2012
Hello, I am creating a form to generate reports using the Reportviwer control and I came across a problem, I have a Dataset created with Dsclient name, I created a clausa to filter the search…
-
2
votes1
answer792
viewsTransitions, Effects for Winforms . NET
How to get the fade-in and out effects, transitions, drives and etc, in forms and their controls in VB.NET, natively or using Frameworks?
-
2
votes2
answers1688
viewsDisplay control in Partial View conditionally
I need a control of a Partial View is displayed according to one condition. For some views a button would appear for others not and this would be set through a parameter in the call of Partial View.…
-
2
votes1
answer701
viewsWindows Service 'System.Typeinitializationexception' on startup
Hello, I am creating a windows service to perform a backup job. I have created other services before but never had a similar problem. Everything was going well, during the development I installed…
-
2
votes1
answer41
viewsGet console location and size in pixels
Is there any way to get the size and location of the System.Console in pixels, don’t tiers? I’ve tried this method: 'Para o tamanho: Dim X, Y As Integer X = Console.WindowWidth * 8 Y =…
-
2
votes1
answer359
viewsBetter performance in a WPF system
How to leave a system in high performance? Follow a MVVM project pattern? I have the following XAML, but when I run it hangs in time to pass the focus to others textBox. Why? My system is too slow,…
-
2
votes1
answer111
viewsSNS AWS in . NET C#
Someone has already implemented SNS in AWS with C#? I implemented the code below in an attempt by sending by topic created by the console, but need to do everything by our ADM on . net. Follow the…
-
2
votes1
answer444
viewsDisable Scrollbar from a Form MDI Container
Does anyone know how to stop Child Forms from moving beyond the screen and displaying a scrollbar? I wish there was a limit to moving the Child Forms... that they only move up to the screen size and…
-
2
votes1
answer115
viewsProgress within a Task
How can I modify the values of an interface control within a separate task from the main thread? Example: private void button1_Click(object sender, EventArgs e) { Task task = new Task(Processar);…
-
2
votes0
answers76
viewsHow to use different language Resources in C#
The following is, by entering some tutorials I was able to create two Resources for my application, and both are working, because when you change the language in the language field of the Form…
-
2
votes2
answers314
viewsSimultaneous tasks (Best way?)
Hello, my dear friends! I’m looking for the best way to work with simultaneous tasks in a graphical environment. I have tried using: (Thread), (Task) and (Backgroundworker). But in all of them I had…
-
2
votes2
answers473
viewsEnd of ASP.NET Webforms?
I wonder if there is a certain trend in ASP.NET Webforms if "retire", leaving only ASP.NET MVC, because according to this article the answer would be yes. The author of the article (Ramon Durães) at…
-
2
votes1
answer54
viewsRefer to the "parent" of the class
How do I reference the "father" within the method? I remember that in Java it was only used this, but in C#? Example: public class UPlayer : RocketPlayer { public void SendMessage(object obj) {…
-
2
votes1
answer51
viewsGetting multiple values from a String
Is there any way to get the arguments like in the example below, in a separate variable? I’m creating a language, and this is an example block: for 0 to 250 step 50 ^^^ ^ ^^ ^^^ ^^^^ ^^ Then I used…
-
2
votes1
answer729
viewsSearch data from related tables
I know that to return the values of a directly related entity in the bank is done so with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how can I get the data from…
-
2
votes1
answer159
viewsApply function to all list elements using VB.NET
Is there a function/module for an object of type List in VB.NET that is similar to array_map() of PHP? The idea is to create a new variable with the elements that satisfy a certain condition. I have…