This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (Exception ex) | |
{ | |
tbOutput.Text = GetExceptionMessages(ex); | |
} | |
... | |
private string GetExceptionMessages(Exception ex) | |
{ | |
var message = ex.Message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Button_Click(object sender, RoutedEventArgs e) | |
{ | |
// Change the cursor to an hourglass | |
Mouse.OverrideCursor = Cursors.Wait; | |
try | |
{ | |
// Perform the long-running operation here | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApp.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<StackPanel> | |
<Expander Header="Expander 1"> | |
<UniformGrid Rows="2" Columns="2"> | |
<Button Content="Button 1"/> | |
<Button Content="Button 2"/> | |
<Button Content="Button 3"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change to the folder where you want to create newBranchName | |
git clone --single-branch --branch features/upgrade ^ | |
C:\Projects\DevOps\MyRepoName newBranchName | |
# C:\Projects\DevOps\MyRepoName is the repo where the branch you want to clone resides in; | |
# newBranchName is relative to current folder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Random 11-digit numbers that pass the ABN algorithm: | |
NOT EXISTS | |
------------------------ | |
18 123 456 789 | |
EXISTS (REAL ABN's) | |
------------------------ | |
46657833902 | |
25091850654 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. **Google**: Google provides OpenID Connect authentication services that can be used to authenticate users with Google accounts. You can find more information about it [here](https://developers.google.com/identity/protocols/oauth2/openid-connect). | |
2. **Microsoft**: Microsoft provides OpenID Connect authentication services that can be used to authenticate users with Microsoft accounts. You can find more information about it [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc). | |
OpenID Connect (OIDC) on the Microsoft identity platform. | |
https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc. | |
Set up an OpenID Connect provider | Microsoft Learn. | |
https://learn.microsoft.com/en-us/power-pages/security/authentication/openid-provider. | |
3. **Okta**: Okta is a cloud-based identity management platform that provides OpenID Connect authentication services. You can find more information about it [here](https://developer.okta.com/docs/guides/implement-openid-conn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>SqlPackage /Action:Import /SourceFile:"C:\TEMP\MyDB.bacpac" ^ | |
/TargetDatabaseName:MyRestoredDB ^ | |
/TargetServerName:(localdb)\MSSQLLocalDB | |
Additional notes: | |
https://techcommunity.microsoft.com/t5/azure-sql-blog/connection-security-improvements-in-sqlpackage-161/ba-p/3672758 | |
https://techcommunity.microsoft.com/t5/azure-database-support-blog/using-sqlpackage-to-import-or-export-sql-server-and-azure-sql-db/ba-p/368861 | |
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Good for small files | |
using System; | |
using System.IO; | |
public class Example | |
{ | |
public static void Main() | |
{ | |
string fileName = @"C:\some\path\file.txt"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sure, here is the C# code to extract records from a text file as a unit, into an appropriate memory data structure which contains Title, and Description: | |
using System; | |
using System.IO; | |
class Record | |
{ | |
public string Title { get; set; } | |
public string Description { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Write a WPF program in C#, the main window should be divided into two columns; | |
The first column contains 7 checkboxes stacked vertically. | |
the second column has a button named btnImport (labelled 'Import'), and a textbox named tbOutput below the button to write any output messages from the import process. | |
Bard:: ==> | |
Sure, here is the WPF program in C# that you requested: | |
using System; | |
using System.Windows; |
NewerOlder