Console Apps
28 TopicsWinUI3 and Win11 Kiosk mode
Hi, I have build a program in C#/WinUi3 to use in Kiosk mode on a Windows 11 machine. The program run fine in either admin or the user to be use for Kiosk mode, but once I have set AssignedAccess to the program for the Kiosk user, when I log using that user I get something that seems like the program starting (waiting cursor and all) but a blank screen with a cursor that I can see, if I click I get a ding sound from Windows and I can Ctrl-Alt-Del to get back to the admin user. Been trying a whole lot of things, but I can't figure out how to debug this one. Anyone with similar experience?10Views0likes0CommentsMYSYS2 Installation Guide for Cross-Compilation on Visual Studio 2017, 2019, 2022, and WSL2
Use Notepad to create this file on your desktop or another folder: MYSYS2.txt MYSYS2 Paths: Use Notepad to create this file on your desktop or another folder: MYSYS2_Path_Win.txt NOTE: This folder layout, which can be easily edited, was generated with a batch file that utilizes the default configuration that comes with the UI-based setup program / installer. Use Notepad to create this file on your desktop or another folder: Generate_MYSYS2_Folder_Paths_Win.bat53Views0likes0CommentsGraph API getAsync() in C#
This is cross posted in Azure as well. If I use graph in a console application I get the information that I request. Such as test = await graphClient.Users.GetAsync(); If I try this in a WebMethod in the code behind of a page or in an .asmx, it never returns with the data. I know this has been mentioned before in many forums, but I did not have issues in V1.0 of the SDK. When I try to use V5+ I can't seem to get the information back. Any ideas on overcoming the issue? Any help would be great.45Views0likes0CommentsConsole App To Write Data To CSV
I am trying to write a pre-defined list of headers to row 1, and List<string> results starting in row 2...my issue is that I get my pre-defined headers written as well as the headers from my List<string> ```cs void WriteResultsToCSV(List<VwExport> records, string fileName) { DateTime currentDate = DateTime.Now; string formattedDate = currentDate.ToString("MM-dd-yyyy"); var filePath = "/Users/owner/Downloads/" + fileName + formattedDate + ".csv"; // Define the headers var headers = new[] { "Job Num", "IM barcode Child", "IM barcode Parent", "ZYL_Presort", "Full Name" }; using (var writer = new StreamWriter(filePath, false, Encoding.UTF8)) using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { foreach (var header in headers) { csv.WriteField(header); } csv.NextRecord(); var trimmedRecords = records.Select(record => new { JobNum = record.JobNum, IMBarcodeDigits = record.ImBarcodeDigits, IMBarcodeCharacters = record.ImBarcodeCharacters, OELPresort = record.OelPresort, FullName = record.FullName }).ToList(); csv.WriteRecords(trimmedRecords); } }```35Views0likes0CommentsCan We add migration file from c#, instead of PackageManagerConsole
Hi, is there any possibilities to add migration file from c# in core project, entity framework code first project. I can able to add the migration file from PackageManagerConsole, but could not able to add from c#143Views0likes1CommentCombine Google Authentication & JWT Tokens using Cookie Authorization
Project is only a web-api, front-end will be developed in react(next.js) Hi guys! I'm a TypeScript Fullstack developer and I'm new to .NET and ASP.NET and basically this is one of my first projects using C# and .NET. My project's architecture requires a kind of different than out-of-the-box way of identifying users. I want Google Authentication which will create a local account (which I can relate other entities to) And JWT Tokens (access, refresh) generated and sent as cookies to the client and each protected endpoint to be using these cookies to authorize the requesting user. I haven't figured out a way of implementing this and still using mostly OOTB tools in order to keep modifications little as possible. Any tips and tricks on how to implement it? Just to be clear, I know how to create endpoints, and protected endpoints using the built in identity framework, using roles, etc... Its this combination of Google Auth, generating tokens, sending them to client as cookies basically is where my difficulty relies. * I have almost a blank new project, already set up with only google credentials205Views0likes0CommentsWhy under arm64, the X64-compiled c# cannot call the x64 dll generated by go?
Under arm64, I am using x64 compiled c# to call go generated x64 dll, the program always abnormal. The same dll, using x64 compiled c++ calls, without any problems Are there any flaws in c# on arm?why c++ code dont have this problem? Thanks578Views0likes1CommentFind email-enabled public folders exclusively using "Microsoft.Office.Interop.Outlook"
Is there a way to exclusively identify email-enabled public folders using Microsoft.Office.Interop.Outlook? EWS or PowerShell should not be used. The program should run on the workstation and utilize the installed Outlook. Once I've found an email-enabled public folder, I should list the emails contained within it. So far, I'm encountering difficulties. For instance, I have the following method: // Recursive method for listing the email addresses of email-enabled public folders static void ListPublicFolders(Outlook.Folder? folder, string indent) { if (folder != null) { foreach (object obj in folder.Folders) { if (obj is Outlook.Folder) { Outlook.Folder? subFolder = obj as Outlook.Folder; if (subFolder != null && subFolder.DefaultItemType == Outlook.OlItemType.olMailItem) { Outlook.MAPIFolder? parentFolder = subFolder.Parent as Outlook.MAPIFolder; string parentName = parentFolder != null ? parentFolder.Name : "Parent folder not found"; Console.WriteLine($"{indent}- {subFolder.Name}: {parentName}"); if (parentFolder != null) { Marshal.ReleaseComObject(parentFolder); } } ListPublicFolders(subFolder, indent + " "); if (subFolder != null) { Marshal.ReleaseComObject(subFolder); } } } } } The query if (subFolder != null && subFolder.DefaultItemType == Outlook.OlItemType.olMailItem) fails because subFolder.DefaultItemType returns the value Outlook.OlItemType.olPostItem, even though the public folder was set up as an email-enabled folder in Exchange. Specifically, this is in Microsoft 365. In the Exchange admin center, when creating the folder, I explicitly checked the box for "Email-enabled." This action resulted in two additional options: "Delegation" and "Email properties." In "Email properties," I can specify an alias and a display name. By default, both fields are set to "Orders." Now, I expect the public folder to be email-enabled, with the email address email address removed for privacy reasons. I don't understand why Outlook is treating the folder incorrectly (I can only create posts and not send emails). Perhaps someone can help me figure this out. Thank you and best regards, René294Views0likes0Comments