How can I access SharePoint files via a C# web api that uses no user authentication?
I have followed numerous guides on how to access SharePoint via C# and no matter what I do I end up with a "401 Unauthorized response:" I am out o fideas. Anybody able to help? Would prefer working code examples. using…
How to calculate years from two different date in ASP.NET C#
I have Employee Admission Date which is stored in SQL table. In the ASP.NET click event, i want to calculate and find the years from the Admission Date and Current Date. For example, Admission Date : 10-MAR-2023 Current Date : 28-APR-2024 condition is…
How to design patterns from scratch using C# asp.net MVC
I am new to building design pattern using factory design pattern, its C# asp.net mvc application which i am going developing my new web application, please can you help me how to start from scratch. I have worked one design pattern application which is…
UWP Designer not showing in Windows 10 22h2
I am using Windows 10 22h2 (19045.4170) and have the latest Windows 11 SDK (22621.0) and Windows 10 SDK (20348.0). In Visual Studio (UWP Project), my target version is Windows 10 version 2104, but I am unable to view the designer and it tells me to…
MailKit fails to authenticate properly with passwords containing certain characters
I have the following block of code to send an email using MailKit: using (var smtp = new MailKit.Net.Smtp.SmtpClient()) { smtp.Connect("mail.somedomainname.com", 587, SecureSocketOptions.StartTls); …
How to publish a program that use SQLITE3? (C#)
Basically i wrote a program that use SQLITE3. The path used in my program is correct because uses the relative path and file is in the correct folder. So, i finished the program and i need to send to another person. This person doesn't need to install…
Windows Server 2012 R2 TLS 1.2 Cipher Suites
Hello - I have a .Net application that accesses an external website to retrieve data. The external website removed TLS 1.1 support and only supports the following TLS 1.2 cipher suites: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384…
c# When should I use decimal data type?
under what kinds of situations should I use decimal data type? and I found that most likely I can use double instead, would someone give me some hints for that? Thank you
Customize the EmailConfirmation and 2FA token expiration in .NET 8.0
Is there a way to extend the 2FA and Email confirmation token expiration timespan with email in .NET 8.0? I am using the Microsoft.AspNetCore.Identity and Microsoft.AspNetCore.Authentication classes to use the 2FA with…
GetFiles and EnumerationOptions
Hi Question at top to avoid long scrolling below. I have tried so many thing, downloading/installing many 'versions' (5,6,7,8,9) and have not had a single sucess in my trials trying to use (as below). In almost every case I only ever get 'not found'…
LinQ - XML special path, condition
I need to change an element value that is dependent on the STEP value. MarkPosition or ControlPosition Can I pre-select better with XPathSelectElements? If so, how? <STEP value="MarkPosition"> <STEP…
efficient way to add csv to database
Hello I read a csv text file line by line and use oldb sql command insert into table to add each line's fields to the table's row. But it takes a very long time, I wonder if there's faster achievements, please advise the most efficient and fastest way to…
C# Generate token console for Intune datawarehouse
Using .NET 4.8.1 and the code snippet below from Microsoft Learn (https://learn.microsoft.com/en-us/mem/intune/developer/data-warehouse-app-only-auth-). I am unable to get this module to work. It seems the line with AuthenticationContext,…
Microsoft Graph API returns no data or unexpected errors for Viva Learning
Hello, I'm exploring options to create a custom learning management system for my company. The first thing I would like to do is to pull data from Microsoft Viva Learning via the Microsoft Graph API, for example to see which courses the employees have…
Direct API POST method to another URL
Good morning, afternoon or night!! Dear all, I will need to be "listening" to an Access device that will be sending a Json in the POST Method. To do this, I created a (simple) API to do this monitoring and respond with a True or False. Problem:…
x:Bind default Mode is "OneTime" or sth else in Windows App SDK ?
I have written the code below: XAML code: <ListView ItemsSource="{x:Bind players}"> ***<ListView.ItemTemplate>*** ***<DataTemplate x:DataType="local:Numbers">*** ***<TextBlock…
How to fix XamlReader.RewrapException(ex, xamlLineInfo, baseUri);
Here is the error System.Windows.Markup.XamlParseException: "'The invocation of the constructor on type 'DentistryOOP.View.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position…
C# Regex pattern double quotes problem
Hello all. In the following code if the user string input is "a"b" or "a\"b" is match a"b string. I don't expect that "a"b" is a valid regex pattern as the code return true in the try catch block. what…
how to export function in dll to aot?
I created .net class library to build dll and want to publish native aot and I write function public static MyClass { public static int MyFun(int n) { return n*n; } } I publish it to native aot to win-x64 but in dll there is no function why?
Custom ApiController Model Binding type conversion error
According to the Model Binding documentation: In an API controller that has the [ApiController] attribute, invalid model state results in an automatic HTTP 400 response. So when I send an invalid type in the request body (e.g. int instead of string),…