10,815 questions with C#-related tags

Sort by: Updated
0 answers

Remote Connection want work.

I tried to make a remote connection in c# but faild. Here is my code, can somebody help me? string strAppDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName); string strConfDir = strAppDir +…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-31T18:17:41.53+00:00
Duneworker 1 Reputation point
commented 2021-02-01T07:42:42.957+00:00
Timon Yang-MSFT 9,591 Reputation points
2 answers

why when i type } in visual studio C# it matches with a different { basically it looks like this:

so my question is why is the first { highlighted with the } at the end of if (movemnt > 0.05) {anim.SetBool("isRunning", true); {anim.SetBool("isRunning", true)

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-31T02:43:34.617+00:00
Dylan Coetzee 1 Reputation point
answered 2021-02-01T03:27:05.013+00:00
Timon Yang-MSFT 9,591 Reputation points
1 answer

Windows Key container

Hi, My application stores data in an SQLite database. I want to store 1 attribute encrypted so that it cannot be changed outside the program. This may only be changed from within the program. I don't want to put the key for the encryption in the code.…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,883 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-29T12:08:20.157+00:00
Hans 251 Reputation points
answered 2021-02-01T02:52:04.333+00:00
Daniel Zhang-MSFT 9,626 Reputation points
1 answer One of the answers was accepted by the question author.

C# foreach loop for true boolen

Good Afternoon, i have created a program that a class will check if bool is true or false but the issue i have is a simple, if(elfbool1 == true ) { then do something } this works fine but i want to check each bool at once as i want each…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-31T15:09:06.733+00:00
elfenliedtopfan5 121 Reputation points
commented 2021-01-31T21:08:27.783+00:00
elfenliedtopfan5 121 Reputation points
1 answer One of the answers was accepted by the question author.

How many Serilog logger instances should be created for different .net app on same machine?

I am new to Serilog. Trying to understand below scenario. If we have 2 different .net application/controls referring to common serilog config file. The file will contain custom prefix tags corresponding to each application. Each app/custom control has…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,755 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-18T15:48:04.623+00:00
rutuja k 21 Reputation points
accepted 2021-01-31T14:26:20.017+00:00
rutuja k 21 Reputation points
3 answers One of the answers was accepted by the question author.

How to override ToString of double?

I want to override the function of a double how to do it? for example: double total=0.5; string t=total.ToString(); I want it return a format that is specified.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-31T01:28:10.127+00:00
mc 4,376 Reputation points
commented 2021-01-31T11:24:47.09+00:00
mc 4,376 Reputation points
3 answers One of the answers was accepted by the question author.

ArrayTypeMismatchException Source array type cannot be assigned to destination array type

I'm tying to get the values in a manually created array into a System based array. Exception Details: System.ArrayTypeMismatchException Message=Source array type cannot be assigned to destination array type. StackTrace: at…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,883 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-27T14:06:39.793+00:00
Art Hansen 566 Reputation points
commented 2021-01-30T10:41:48.227+00:00
Art Hansen 566 Reputation points
1 answer

C# How to capture console window close

I found few write up for this topic https://stackoverflow.com/questions/4646827/on-exit-for-a-console-application …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-29T15:53:09.29+00:00
Sudip Bhatt 2,276 Reputation points
commented 2021-01-30T08:18:25.053+00:00
Castorix31 84,276 Reputation points
4 answers

Xamarin Forms, How can i send the items from a ListView by email

Hi Xamarin Community, I need help with something I am wondering around, how can I send pdf file using Xamarin forms, but in the file I need to bind the items in my listview like description, price, quantity, Hope you can help me Regards

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,333 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-21T20:24:44.517+00:00
Amasu 96 Reputation points
answered 2021-01-30T07:03:28.663+00:00
Selva Ganapathy K 1 Reputation point
0 answers

Xamarin Forms, PDF ListView Using PDFSampleListRendererDelegate

Hi Xamarin Forms Community, I am desing a PDF from a listview, but I have a question about the margin of the image attachment I will put the code here: public class PDFSampleListRendererDelegate : PdfListViewRendererDelegate { …

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,333 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-26T22:17:15.57+00:00
Amasu 96 Reputation points
commented 2021-01-30T05:51:33.313+00:00
Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
3 answers One of the answers was accepted by the question author.

Problem Serial Port bytes missing with write method

Hi everyone, I am using Visual Studio 2013 (C#) in order to test serial port. I have an array of bytes and I am trying to send it via Serial Port using two USBSerialConverter. The data that I receive is between 14 to 18 bytes of lenght (it change…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-24T08:36:12.19+00:00
tomrod 96 Reputation points
accepted 2021-01-30T04:18:19.407+00:00
tomrod 96 Reputation points
3 answers One of the answers was accepted by the question author.

C# XML file - collect all elements with the value.

Hello, I have a XML file and need to collect all values from YPOS into a new list with index and value. How can I easily reach this? Thanks in advance. The goal is a list with Index, YPOS 1, 41.352 2, 51.352 3, 61.352 4, 71.352 …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-28T16:52:46.037+00:00
Markus Freitag 3,786 Reputation points
accepted 2021-01-29T16:47:41.917+00:00
Markus Freitag 3,786 Reputation points
2 answers One of the answers was accepted by the question author.

C# regex that should start with alpha numeric but not with space

Hi , I am trying for regex that should take only AlphaNumeric as first character but when i go with [A-za-z0-9], it is also taking white space as valid, how to avoid space as first character in regex C#. please help. below are some valid and…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,775 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,449 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-25T12:30:58.67+00:00
sravan kumar 121 Reputation points
accepted 2021-01-29T14:58:48.133+00:00
sravan kumar 121 Reputation points
7 answers One of the answers was accepted by the question author.

What is "localhost:44313"

I have an ASP.NET project working with IIS on Azure. In Web.config I have <add key="Url" value="https://localhost:44313" /> and there is a call in the C# code WebRequest request = WebRequest.Create(sURL); where sURL =…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,501 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-26T09:13:57.213+00:00
John Papaioannou 21 Reputation points
accepted 2021-01-29T08:36:54.53+00:00
John Papaioannou 21 Reputation points
1 answer One of the answers was accepted by the question author.

Different nuget-packages are used when compiling using VS and compiling using MSBuild

Consider following .csproj file: <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> <OutputType>WinExe</OutputType> …

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,775 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-28T19:11:55.103+00:00
Steven Degrendele 21 Reputation points
accepted 2021-01-29T07:37:04.937+00:00
Steven Degrendele 21 Reputation points
1 answer

C# equivalent of Python's pack/unpack and sum?

Is there any function equivalent to Python's struct.pack and struck.unpack in C# that allows me to pack and unpack values like this? comman_type = 1 command_class=5 command_code=0x14 arg0=0 arg1=0 packed_message =…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-28T12:11:10.837+00:00
QuatreHuit 1 Reputation point
answered 2021-01-29T06:08:56.57+00:00
Daniel Zhang-MSFT 9,626 Reputation points
2 answers

How will click-once work when upgrading to .Net 5.0?

We have several WPF applications that we distribute using Click-Once delivery. Fortunately this technology continues to work, mostly, as we don't want to start dealing with direct client installations. Will this technology continue to be supported with…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,755 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-28T22:11:04.433+00:00
Rich, Aaron 1 Reputation point
answered 2021-01-29T04:27:51.617+00:00
Lex Li (Microsoft) 5,492 Reputation points Microsoft Employee
1 answer

Can you answer this queue act?

Accept characters using the Implementation of Array Structure, then save it to Queue. If the value to be stored in the queue is equivalent to input of the user, count and display its occurrence. Count the total values inputted by the user. If…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-28T15:13:12.457+00:00
Jayliepedraza 1 Reputation point
answered 2021-01-29T02:12:59.47+00:00
Timon Yang-MSFT 9,591 Reputation points
0 answers

Impersonate session security context error without applying impersonation

Hi, So I have an app that creates a SQL connection with MARS enabled and also impersonation, but it doesn't do calls in more than one thread (legacy system), and that app calls a service that also creates a SQL connection with MARS enabled, but without…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,617 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-22T17:27:29.843+00:00
Josué Zatarain 1 Reputation point
commented 2021-01-28T22:02:36.53+00:00
Erland Sommarskog 109.5K Reputation points MVP
2 answers One of the answers was accepted by the question author.

Mocking IEventGridClient using the Moq library

I'm trying to mock IEventGridClient from the Microsoft.Azure.EventGrid NuGet package with the Moq library for unit testing purposes. Mock<IEventGridClient> client = new(); client.Setup(x => x.PublishEventsAsync(It.IsAny<string>(), …

Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
374 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
asked 2021-01-22T13:03:07.3+00:00
Ershad Nozari 421 Reputation points
accepted 2021-01-28T19:32:29.62+00:00
Ershad Nozari 421 Reputation points