Questions tagged as 'c#'

1
answer

Class protected and public

What is the behavior of a protected class? What is the impact of access modifiers (especially private and protected) on classes, and what are their common uses? I can understand its functionality when attributed to methods, properties and...
asked by 03.06.2014 / 15:50
2
answers

Insert checkbox dynamically by Json return does not display Text?

I am creating a list of Checkbox according to the selection of a Select on the same screen. In the event change of select is called via ajax javascript , the method that returns a Json with list (valu...
asked by 14.01.2017 / 22:09
1
answer

Convert an object of type 'System.Collections.Generic.List in type' System.Data.DataSet '?

   Can not convert an object of type 'System.Collections.Generic.List in type' System.Data.DataSet '? After making a query for a report, I am saving the data in a list and displaying the data on the screen, plus I have an option to export th...
asked by 17.01.2017 / 16:38
1
answer

Is it possible to restrict who can use public classes in an assembly?

The scenario is as follows: I have a AssemblyProtegido.dll written in .NET that contains public classes. I would like only specific assemblies to consume such classes. AssemplyProtegido.csproj public class ClasseProtegida {...
asked by 05.01.2017 / 00:12
1
answer

Copying text from one text file to another

I wanted to copy the text from one text file to another with a different name and add one - at the beginning of the line of the text file. For example: I have a text file with the following text "0000192" and when copying it to another tex...
asked by 19.10.2017 / 17:17
2
answers

Why do we pass an object to the statement lock?

I'm working with multithreading and fell into a competition case. More than one thread accessed an I / O operation on the same file and so an exception was thrown. To solve the problem, I did so: private static object padlock = new object(...
asked by 10.11.2017 / 12:21
1
answer

What is the usefulness of Task.Yield?

The documentation for this method says:    Task Method. Yield () - adapted from English   Creates a startling task that returns asynchronously to the current context when awaited . I read the source code for it and got lost even...
asked by 24.09.2017 / 12:26
2
answers

Create dll in C # and use in Delphi 7

I need to create a C # dll so I can use it in delphi. I've tried the following: I created a basic dll with a sum method, but calling it in delphi does not return anything, it would be like the created method did not exist. Below the c...
asked by 02.09.2016 / 15:52
1
answer

How to change the template (visual) of a page asp net mvc5 according to user

How would I do this using areas, and navigating through the main controllers (which are at the root of the project). Basically it is the following: www.algumacoisa.com/home/index = > redirect to the controller that will check t...
asked by 30.08.2016 / 05:58
1
answer

Catch the time on a remote computer using C #

Is there any method for me to be able to retrieve the time and date from a remote computer using C #?     
asked by 28.09.2016 / 16:20