Doesn't C# support escape sequences when we use verbatim?
Hello, I read "a verbatim string literal is prefixed with @ and does not support escape sequences." I have two questions: 1- If C# doesn't support escape sequences when we use verbatim, so how can I use an escape sequence…
Passing variable argument in a loop to eventhandler
In WPF I have a Styles button in which I add items with the different styles: <Button x:Name="Form_Estilos"> <Button.ContextMenu> <ContextMenu x:Name="Form_Estilos_Items"/> <ItemsControl> …
C# reading encrypted file returns Black diamonds with ? inside
I have an encrypted file that contains the following chars. áÒá,èÜÒè what I see when debugging is Black diamonds containing "?". I think my open/read file is using the wrong file data type. (unicode, ascii, etc..) and not correctly reading…
C# windows form crash
Hi, I'm writing my Windows forms project in C# using the latest versione available of Visual Studio Community (17.9.3). The project manages a Modbus TCP client connection using the NModbus library to a proprietary and tested server. The connection is…
Number of query values and destination fields are not the same
Hi All, I received the TXT files from my vendor every morning. My objective is to convert this TXT file into Excel (.xlsx) file for my internal customer. I would appreciate it if you can point me in the right direction to resolve the issue. Thank you; I…
Window.GetWindow() of TabItems content does not return the right window when TabItems State changes
When using TabControl in two windows, each TabItem contains a button with a click event that displays the parent window of the TabItem using Window.GetWindow(). After DragAndDrop a TabItem from one window to another, GetWindow() still returns the…
Accessing certificates local storage
Hello All, We wanted to know a few things about the certificate management store and accessing the certificates using C#: Are the certificates installed in the 'Certificate Management Store' (both current user and local computer) stored in any default…
UWP How to cancel a file search
I have a code to search for files in a user's selected folder, the file search takes some time and I need to be able to cancel it if the user changes the folder QueryOptions options = new QueryOptions(CommonFileQuery.OrderByName, filesExtensions) {…
Unable to fetch some group properties via C# SDK
I am trying to fetch groups via graph api and get resourceBehaviorOptions and resourceProvisioningOptions properties. Eventhough these properties exist in the direct graph api response, I am unable to find them when I use c# graph SDK. I can see these…
Connection Manager not getting Iniialized
Hi, I'm currently writing a C# code in Script Component which is making a connection to MSSQL DB using ADO.NET Connection Manager. But it returns a NullReferenceException every time when I run it. I have tried the sample code as mentioned in the link …
what is the new technology to replace MFC?
I'm looking to develop a new software to replace a current version (this is a software that shows map and tracks fast moving vehicles). The current version was written in MFC C++ and MFC is becoming obsolete. My question is what new tools from Microsoft…
Taskbar Color Reverts When Changing Color Using SetWindowCompositionAttribute in WinUI3
Hi, I am encountering an issue with the taskbar color on Windows. When I change the taskbar color using the SetWindowCompositionAttribute method, the color initially changes as expected. However, as soon as I click the 'Start' button, the taskbar color…
MSI application uninstall not working properly after windows update
While uninstalling our MSI Application, we have shown a custom exception message when MSI application is running in the background. To show custom message we have override the installer file . namespace SampleApplication { [RunInstaller(true)] …
There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'TenDonVi'.
At the first time, I used like this and it worked well, there is no error about this: (Controller) public ActionResult EditNV(int? id) { var nhanVien = db.NhanViens.Include(nv => nv.LichSus).FirstOrDefault(nv => nv.MSNV…
How to binding ViewModel's SearchText variable to the DataGrid Cell as a converter parameter?
I've an other question: How to binding ViewModel's SearchText variable to the DataGrid Cell as a converter parameter. I'm using a converter to change ViewModel's list's field name: "content" to highlightedText textBlock. but the Convert method…
Is the October 2024 MFA enforcement applied on MSAL.NET accessing the Microsoft Graph API?
As mentioned on many channels Microsoft want to enforce MFA on administration portals, Azure CLI, Azure PowerShell, Azure Mobile app and IaC…
converting VB asc() to C# Code
I'm trying to convert the following VB code to C# I'm stuck on the C# equivalent of VB's ASC this //Newstr = Newstr & chr(asc(Mid(str,x,1)) - Asc(Mid(key,KeyPos,1))) to this Newstr = Newstr & Convert.ToChar(asc(reverseString.Substring(x, 1)) -…
What is the largest integer number that can be stored in a float in C#?
Hello, According to Microsoft Docs, we can store an integer up to 3.4 * 10^38, so why can't I store 100,000,001 in a float? Well, 100,000,001 is less than 3.4 * 10^38.
System.IO.FileNotFoundException: 'Could not find file '
I have the file located in my directory in C:\Users\Cerburus\source\repos\CST-150 ListToGridView\CST-150 ListToGridView\bin\Debug\net8.0-windows\Data\topic6.txt But I keep getting the exception file not found. please I need help internal class…
Can we store/retrieve data from Share Point list using a WPF C# application?
I am working on WPF C# application. Right now, I have the application connected to SQL database to store and retrieve data. However, I am curious to explore the options to replace it with Share Point List. So that, whatever the data I create using my WPF…