Category "c++sharp"

How to automatically upload file after file has been chosen

I have the following code for uploading a file in my site: @using (Html.BeginForm("UploadProfileImage", "Member", FormMethod.Post, new { @encType = "multipart/

How to get Priority of C# PriorityQueue element

I am initializing a priority queue that stores XY coordinates, prioritized by their euclidian distance from origin. I created a custom Comparer that makes this

System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString') asp.net Core Docker-compose

I have a dockerized asp.net Core application trying to connect to a mySql Database. Both are running inside a docker-compose. When I test the connection to a lo

Converting EML's to MSG's

We have a webapplication that allows users to view emails in a table and double click on them to open them in outlook. For that we use the (simplified) piece o

Use Middleware for some controllers

In my ASP Net Core application I need to apply a custom Middleware only for specific controller. I found this example app.UseWhen(context => context.Reques

A reference to the dll could not be added. The component is Automatically Referenced C#

I am getting an error in C# Visual Studio and there doesn't seem to be any clear-to-the-point answer to this question online. When I want to add mscorlib, I get

How is Activity.Text encoded Microsoft Teams?

I am writing a custom Teams bot. I got some questions about Activity.Text field: How is it encoded? I see some <at> tags when the bot is @mentioned, but

How do you create Xamarin Forms class hierarchies inheriting from the 'Page' type?

In Xamarin.Forms, I'm trying to create a page that I then subclass, like this: public partial class PageA : ContentPage { public PageA() {InitializeComponent

How to show a Message Dialog in GTK using GTK# (Mono)

I would like to show a dialog inside my GTK# application (I'm using MonoDevelop). Sorry for the silly question, but I'm pretty new to GTK and Linux in general.

VSTO with Windows Form and Worker Threads

I have an Office addin (Outlook if it makes a difference) created with VSTO. The addin creates a Windows Form at startup. My Form creates several threads. I'

Evaluate Conditional Expression

I have a scenario in which I am saving my "if" conditions in database as a string. For example: String condition = "(([age] >= 28) && ([nationality]

How to detect other outlook events such as "Forward as attachment", "Reply with Meeting"

Out of the box outlook provides the following: ((Outlook.ItemEvents_10_Event)this._mailItem).Reply += new Outlook.ItemEvents_10_ReplyEventHandler(MailItem_Repl

Using Layers and Bitmask with Raycast in Unity

Unity's Raycast functions has a parameter you could use to raycast to a particular GameObject. You can also use that parameter to ignore particular GameObject.

How to set connection time out when establishing context - PrincipalContext

using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Domain, UserName, Password)) { UserPrincipal U = new UserPrin

Collection of AddressEntry object from Global Address List MSDN

Using below code snippet i can get single addressEntry object that is 1st matched. How to get the collection of matching addressEntries objects under global add

How to use c# tuple value types in a switch statement

I'm using the new tuple value types in .net 4.7. In this example I am trying to make a switch statement for one or more cases of a tuple: using System; namespa

How can I link Image Source = "?" with Value from DataTable (path image) in WPF?

I am looking to change the value Source = "img / Best / 1.png" for the DataGrid cell that I clicked on, with a click, a button, any option. How can I bind the v

How to create a .RC file to include version information & icons?

Im a bit new to this stuff. I Want to generate a .rc file that would include Version Information & Also contain Icons in it.. Version Information: VS_VERS

Use Serilog with Microsoft.Extensions.Logging.ILogger

I've created a .NET Core 3.1 project using a Host, the IoC container with IServiceCollection and implemented logging allover the place using the ILogger<T>

How do I get client IP address in ASP.NET Core?

Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables["REMOTE_ADDR"] does not work.