Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
sealed class Program {
[STAThread]
static void Main() {
Form1 app = null;
try {
if ( Thread.CurrentThread.CurrentCulture.Name.StartsWith( "de" ) )
Program.SetCurrentCulture( "de" );
else
Program.SetCurrentCulture( "en" );
Application.EnableVisualStyles();
Application.DoEvents();
app = new Form1();
Application.Run( app );
}
catch ( Exception ex ) {
MessageBox.Show(
string.Format( "{0}{1}{1}{2}", ex.GetType().FullName, Environment.NewLine, ex.ToString() ),
string.Format( "{0} ({1})", ex.Source, ex.GetType().Name ) );
}
finally {
if ( app != null ) {
app.Dispose();
app = null;
}
GC.WaitForPendingFinalizers();
GC.Collect();
}
}
public static void SetCurrentCulture( string Culture ) {
Thread.CurrentThread.CurrentUICulture = new CultureInfo( Culture );
switch( Culture ){
case "de":
Thread.CurrentThread.CurrentCulture = new CultureInfo( Culture + "-" + Culture.ToUpper() );
break;
case "en":
Thread.CurrentThread.CurrentCulture = new CultureInfo( Culture + "-GB" );
break;
}
}
}
this.SuspendLayout();
ResourceManager resources = new ResourceManager( this.GetType() );
foreach( Control _control in this.Controls )
if ( !excludeList.Contains( _control.GetType() ) )
_control.Text = resources.GetString( myControl.Name + ".Text" );
this.ResumeLayout();
GC.WaitForPendingFinalizers();
GC.Collect();