- .NET
- Hosting
- Can IIS application pool identity be configured to operate with a gMSA account?
- Can I use an IIS Application Pool Identity within a database connection string?
- How to prevent the IIS version number and server name from being returned in the response headers
- Can I host a .NET 10 Blazor WebAssembly app on GitHub Pages
- SQL Server
This file contains hidden or 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
| $urls = @("http://example.com", "http://example2.com") # Add the URLs you want to check here | |
| foreach ($url in $urls) { | |
| try { | |
| $response = Invoke-WebRequest -Uri $url | |
| if ($response.StatusCode -eq 200) { | |
| Write-Host "Website $url is up and running." | |
| } else { | |
| Write-Host "Website $url is not responding properly. Status code: $($response.StatusCode)" | |
| } |
This file contains hidden or 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
| namespace MyApp; | |
| using System.Reflection; | |
| public record class AssemblyInformation(string Product, string Description, string Version, string InformationalVersion) | |
| { | |
| public static readonly AssemblyInformation Current = new(typeof(AssemblyInformation).Assembly); | |
| public AssemblyInformation(Assembly assembly) | |
| : this( |
This file contains hidden or 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
| <a class="os-iframe-link" href="https://embed.opensports.net/iframe/events?aliasID=PhiladelphiaVolleyball"></a> | |
| <script src="https://embed.opensports.net/dist/iframe.min.js"></script> |
This file contains hidden or 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
| --modified from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table | |
| --added table and column | |
| declare @TableName sysname = 'TableName' | |
| declare @Result varchar(max) = '[Table(Name = "' + @TableName + '")] | |
| public class ' + @TableName + ' | |
| {' | |
| select @Result = @Result + ' | |
| [Column(DbType = "' + |
This file contains hidden or 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
| [HtmlTargetElement(Attributes = "is-active-page")] | |
| public class ActivePageTagHelper : TagHelper | |
| { | |
| /// <summary>The name of the action method.</summary> | |
| /// <remarks>Must be <c>null</c> if <see cref="P:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper.Route" /> is non-<c>null</c>.</remarks> | |
| [HtmlAttributeName("asp-page")] | |
| public string Page { get; set; } | |
| /// <summary> | |
| /// Gets or sets the <see cref="T:Microsoft.AspNetCore.Mvc.Rendering.ViewContext" /> for the current request. |