Skip to content

Instantly share code, notes, and snippets.

View BoolHak's full-sized avatar

Bilel Methnani BoolHak

  • BMDRM
  • Tunisie Sousse
View GitHub Profile
@Delaire
Delaire / CoreTools.cs
Last active June 17, 2025 08:49
UWP, C# - Retrieve the redirect url using HttpClient from the Headers of the Response - [HttpClient,C#]
public static class CoreTools
{
public static async Task<string> GetRedirectedUrl(string url)
{
//this allows you to set the settings so that we can get the redirect url
var handler = new HttpClientHandler()
{
AllowAutoRedirect = false
};
string redirectedUrl = null;
@jrusbatch
jrusbatch / AvailablePorts.cs
Created December 5, 2012 02:17
Find an Available Port with C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;
using System.Net;
namespace AvailablePort
{
class Program