Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

{.NET] Packing a single-file executable

Featured Replies

Posted

Found a nice snippet

it's from the book

OReilly.C.Sharp.4.0.in.a.Nutshell

Packing a single-file executable:

using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;public class Loader
{
static Dictionary <string, Assembly> libs
= new Dictionary <string, Assembly>(); static void Main()
{
AppDomain.CurrentDomain.AssemblyResolve += FindAssem;
Program.Go();
} static Assembly FindAssem (object sender, ResolveEventArgs args)
{
string shortName = new AssemblyName (args.Name).Name;
if (libs.ContainsKey (shortName)) return libs [shortName]; using (Stream s = Assembly.GetExecutingAssembly().
GetManifestResourceStream ("Libs." + shortName + ".dll"))
{
byte[] data = new BinaryReader (s).ReadBytes ((int) s.Length);
Assembly a = Assembly.Load (data);
libs [shortName] = a;
return a;
}
}
}public class Program
{
public static void Go()
{
// Run main program...
}
}

nutshell

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.