Category "c++sharp"

Remove leading zeros from time to show elapsed time

I need to display simplest version of elapsed time span. Is there any ready thing to do that? Samples: HH:mm:ss 10:43:27 > 10h43m27s 00:04:12 > 4m12s 0

Unable to start process dotnet.exe

I am attempting to setup a new work space and transfer all of my projects from my old computer to the new one. However, I am getting this error when I try to r

How to access HttpContext and Request in RequireAssersion?

I'm trying to create a custom authorization policy. Let's say I want the URL to contain a token. For example: https://example.com/customer/list?token=2nHxltsDOj

c#: keep ref parameter from constructor in class

Basically i would like to be able to have a reference to a variable inside a instance of a class, but i'd like the reference to become a class variable so I don

set default value in class constructor C#

I need a default value set and many different pages access and update..initially can I set the default value in the class constructor like this? What is the pr

Can't use custom extension methods with IronPython

I have some extension methods I defined in my C# class, which I can import just fine into an IronPython script. However, when I attempt to call one of these met

How can get a substring from a string in C#?

I have a large string and it’s stored in a string variable, str. And I want to get a substring from that in C#. Suppose the string is: " Retrieves a subst

How to perform image lighting correction with OpenCV?

I have an image which I grab using a camera. Sometimes, the lighting is uneven in them image. There are some dark shades. This causes incorrect optimal threshol

WPF Tab Control Prevent Tab Change

I'm trying to develop a system maintenance screen for my application in which I have several tabs each representing a different maintenance option i.e. maintain

How to get the error message of a Process?

For vsinstr -coverage hello.exe, I can use the C# code as follows. Process p = new Process(); StringBuilder sb = new StringBuilder("/COVERAGE "); sb.Append("

Unable to create an object of type 'MyContext'. For the different patterns supported at design time

I have ConsoleApplication on .NET Core and also i added my DbContext to dependencies, but howewer i have an error: Unable to create an object of type 'MyCon

how to convert an array of objects to json

I have an array of objects. now I want to convert them to json. var dd =new MyUser[10]; for (int i = 0; i < 10; i++) { Debug.Log

Automapper:Converting JSON to list of objects

Source Object (JSON, using JSON.NET if it matters): { "conum" : 1001, "name" : "CLN Industries Corporation", "agencyName" : "Murphy, Holmes & A

How to cancel .Net Core Web API request using Angular?

I have the following two applications Angular 6/7 App .Net Core Web API I am making GET request to API using Angular's HttpClient as shown below this.subscrip

How to create and install test adapter in Visual Studio

I want' to create a protractor test adapter for Visual Studio. I have found I can create it with implementing ITestExecutor and ITestDiscoverer. I follow the Ma

How to change Text of button in FileUpload control and set value to textbox

Hi I want to upload file using c# but want to display as below image. I want to change the text of button from default “Browse” to “Upload&

How to retrieve list item attachments with SharePoint 2013 Event Receiver in correct order

I've created a Standard SharePoint 2013 Event Receiver on a custom list. Watched Event = "ItemAdded". Later in my code I need to retrieve the attachments of t

Splice IEnumerable with Linq

Is there an in-built way to splice an IEnumerable in Linq-To-Objects? Something like: List<string> options = new List<string>(); // Array of 20 st

Create HTML table from a list

I am trying to get some values from a List and then create a html table with this data but I can't get it to work properly. I have: HtmlTable table = new HtmlTa

Procedure or function expects parameter which was not supplied, when parameter is auto-generated

I'm trying to insert data in my db. this is the code im using SqlCommand cmd = new SqlCommand("dbo.UsersInsert", cnn); cmd.CommandType = CommandType.StoredPro