10,520 questions with C#-related tags

Sort by: Updated
5 answers One of the answers was accepted by the question author.

C# beginner: program flow not understood

I’m just starting to follow a tutorial at https://csharp.net-tutorials.com/ I’m trying to understand why the processing flow doesn’t “drop through”. In the first code set it stops after the main block despite no errors being identified by VS. The second…

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,520 questions
asked 2020-11-22T09:01:15.743+00:00
Art Hansen 566 Reputation points
commented 2020-11-28T05:49:23.53+00:00
Bonnie DeWitt 811 Reputation points
1 answer One of the answers was accepted by the question author.

Check only one line of the string

Hi, is it possible to check if only one line of the stringbuilder matches to another string? //Server Token Datei lesen string server_token_string; using (StreamReader sr = new StreamReader(@$"{localappdata}\Liquid…

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,520 questions
asked 2020-11-24T10:11:00.19+00:00
RobinJ 276 Reputation points
accepted 2020-11-26T19:41:25.707+00:00
RobinJ 276 Reputation points
2 answers One of the answers was accepted by the question author.

C:\Documents and Settings' is denied

Hello. I used the code below. If i it run "C:\Documents and Settings' is denied" appears. How can I skip denied folders? Thank You. string rootDirectory = System.IO.DriveInfo.GetDrives()[0].RootDirectory.FullName; string[] files =…

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,520 questions
asked 2020-11-25T18:07:44.527+00:00
Blader 156 Reputation points
answered 2020-11-26T16:06:05.133+00:00
Blader 156 Reputation points
1 answer One of the answers was accepted by the question author.

LinQ, GroupBy, C#, sub list, check state - improvement of the query

Hello, The below code works very well. The question is, can I solve this in one query? If so, how would I implement it? I want to know if a position has a bad status. If so, the product is bad. Return value is bool. Thanks for tips in advance! var…

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,699 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,520 questions
asked 2020-11-26T08:25:37.973+00:00
Markus Freitag 3,786 Reputation points
accepted 2020-11-26T15:29:05.59+00:00
Markus Freitag 3,786 Reputation points
2 answers

Why Am I Getting Error Using TransactionScope?

Hi, Everybody! I am having trouble with TransactionScope. I want my web method to be transactional. If any exception occurs, I want all database changes rolled back. Otherwise, commit. Please see error message below. System.ApplicationException:…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,542 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,520 questions
asked 2020-11-21T04:37:00.397+00:00
Julio Bello 221 Reputation points
answered 2020-11-26T13:13:29.98+00:00
Nuno Pereira 1 Reputation point
2 answers

Datepicker accessibility Issues.

Hi I have added a datepicker in Windows Forms Application. I need system to read out the date that is selected Or Focused when Screen Reader or Narrator is turned ON. Example: When The start date is Highlighted then it should…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,865 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,520 questions
asked 2020-11-26T06:16:22.21+00:00
Prasad Babu Konduru 11 Reputation points Microsoft Vendor
answered 2020-11-26T10:53:59.95+00:00
Prasad Babu Konduru 11 Reputation points Microsoft Vendor
3 answers

How to fin Class/Entity References and Line Number

Hi folks, I hope you are doing well. I want to write a program in C# that extract the class/entity references and with there line numbers where it is used in solution. I do research from internet I have found some references() but it can't me help.…

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,520 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,136 questions
asked 2020-11-26T05:53:05.417+00:00
Saifullah 1 Reputation point
commented 2020-11-26T10:40:35.217+00:00
Saifullah 1 Reputation point
1 answer One of the answers was accepted by the question author.

How to create a single diminsional array starting from index 1 instead of zero

I am trying to create an single diminsion array that starts from 1 and ends at 7. I tried this: Int32[] lowerBounds = {1}; Int32[] lengths = {7}; Int32[] Julia = (Int32[]) Array.CreateInstance(typeof(Int32), lengths,…

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,520 questions
asked 2020-11-25T15:59:59.053+00:00
Emmad Kareem 81 Reputation points
commented 2020-11-26T07:18:10.21+00:00
Emmad Kareem 81 Reputation points
1 answer One of the answers was accepted by the question author.

I can't get my custom click event to work.

Hello. I have this class written. public class MyButtonSimple : Button { // Create a custom routed event by first registering a RoutedEventID // This event uses the bubbling routing strategy public static readonly RoutedEvent TapEvent =…

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,699 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,520 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
778 questions
asked 2020-11-25T02:23:20.583+00:00
A N 81 Reputation points
accepted 2020-11-26T03:28:32.47+00:00
A N 81 Reputation points
1 answer One of the answers was accepted by the question author.

Input string was not in a correct format.

When i am inserting Decimal value from textbox to gridview asp.net Webform, then below error is coming , Input string was not in a correct format. Below line int price = Convert.ToInt16(txtprice.Text); My Code for inserting data into gridview is…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,383 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,520 questions
asked 2020-11-25T12:43:12.727+00:00
Analyst_SQL 3,551 Reputation points
accepted 2020-11-25T14:11:05.693+00:00
Analyst_SQL 3,551 Reputation points
0 answers

StatusCode: 404, ReasonPhrase: Not Found', Version: 1.1

i need help i keep getting this error locally it works when posting an image through post man but from my xamarin forms app to the local iis server i get this error {StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content:…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,306 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,520 questions
asked 2020-11-24T07:34:04.987+00:00
Ahmad salim 1 Reputation point
commented 2020-11-25T08:54:51.43+00:00
Brando Zhang-MSFT 3,281 Reputation points Microsoft Vendor
1 answer

C# Rest api

Hello, i made an Rest api in .net Core while i ran the api on local it worked fine, but from the moment i published it the /api/Page Doesnt work i get a removed error, i found (i think) this is because there is no www.root in my project ? but i'm…

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,520 questions
asked 2020-11-23T21:33:39.413+00:00
Leandro Ostyn 6 Reputation points
answered 2020-11-24T18:45:16.647+00:00
Leandro Ostyn 6 Reputation points
0 answers

How to stop a function in middle in C#?

It may be a basic question, But I could not find an answer for that. I have a function having some sync and async statements. It would take at least 10 seconds. I want to stop that method in the middle at any time. I know that I can use a flag like…

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,520 questions
asked 2020-11-24T13:08:23.667+00:00
MG Bhadurudeen 626 Reputation points
1 answer One of the answers was accepted by the question author.

Export a string

Hi, How can i use the string "server_token_string" outside of the using? using (StreamReader sr = new StreamReader(@$"{localappdata}\Liquid Aqua\API\server_token.txt", Encoding.Default)) { …

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,520 questions
asked 2020-11-23T20:39:18.923+00:00
RobinJ 276 Reputation points
accepted 2020-11-24T10:04:05.343+00:00
RobinJ 276 Reputation points
1 answer One of the answers was accepted by the question author.

else geht nicht

Liebe Community Ich habe zwei mal ein if/else in meinem Code. Das erste if/else geht ohne Probleme, das zweite jedoch funktioniert nicht. unten ist das if else welches nicht geht. if (server_tokens_string == token_eingabe);…

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,520 questions
asked 2020-11-20T09:20:45.193+00:00
RobinJ 276 Reputation points
commented 2020-11-24T08:41:45.543+00:00
Timon Yang-MSFT 9,576 Reputation points
2 answers

Programmatically determine if WiFi direct is supported

I would like to programmatically determine if WiFi direct is supported on a given windows 10 machine... including a foreign windows 10 OS. Most of the articles I have come across involve "IpConfig /all" and then searching for the string…

Universal Windows Platform (UWP)
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,520 questions
asked 2020-11-23T23:11:56.077+00:00
Jason 1 Reputation point
answered 2020-11-24T08:17:52.16+00:00
Castorix31 82,501 Reputation points
0 answers

Adding tags to a Header with AddressHeader.CreateAddressHeader

I am trying to add some tags to the Header of a SOAP request, but I cannot insert this tag: <ReplyTo xmlns="http://www.w3.org/2005/08/addressing"> <Address>http://www.w3.org/2005/08/addressing/anonymous</Address> …

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,520 questions
asked 2020-11-21T10:44:03.893+00:00
Infoservice 1 Reputation point
commented 2020-11-23T09:35:32.923+00:00
Timon Yang-MSFT 9,576 Reputation points
0 answers

Change field text color(red) on Main Entity and Subgrid using Javascript (Unified Interface)

I am currently using Dynamic 365 Unified Interface whereby on the javascript web resource which is using XMLHttpRequest(Retrieve data) to change some text field color on certain tabs and subgrid entity. May I know what will be the correct syntax on…

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,520 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,136 questions
asked 2020-11-20T02:59:23.587+00:00
Kweh Hong Yang 1 Reputation point
commented 2020-11-23T08:06:52.07+00:00
Timon Yang-MSFT 9,576 Reputation points
1 answer One of the answers was accepted by the question author.

Why does ToolStripMenuItem OnPaint draws only the first item?

Hello, I'm trying to add white space within the item's text in a ContextMenu for that the string after the space is always left aligned and always stands under each other in each item. What I'm trying to do in the following code: I add the items to…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,865 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,520 questions
asked 2020-11-21T18:22:40.6+00:00
chris harper 96 Reputation points
accepted 2020-11-21T22:43:07.78+00:00
chris harper 96 Reputation points
1 answer One of the answers was accepted by the question author.

replace a chart.serie with new values

Is it possible to empty 1 serie in a chart that is constantly being built up with the help of a timer and fill it with 1 value? So that a straight line is put in the chart for this series. So i want to update the Yvalue of a chart.serie. I found that i…

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,520 questions
asked 2020-11-21T08:36:35.643+00:00
Hans 251 Reputation points
accepted 2020-11-21T14:09:00.893+00:00
Hans 251 Reputation points