Internetverbindung in Windows 8-App überprüfen

Hier ein kleines Beispiel, das zeigt, wie man in einer Windows 8-App mit C# überprüfen kann, ob das System gerade Internetzugriff hat oder nicht:

Methode: CheckIfUserIsOnline

1
2
3
4
5
6
7
8
9
10
11
12
private bool CheckIfUserIsOnline()
{
  bool isOnline = false;
  ConnectionProfile profile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
  if (profile != null)
  {
    NetworkConnectivityLevel connectivityLevel = profile.GetNetworkConnectivityLevel();
    if (connectivityLevel == NetworkConnectivityLevel.InternetAccess)
      isOnline = true;
  }
  return isOnline;
}

Internetverbindung in Windows 8-App überprüfen weiterlesen

Connecting to a MySQL Database with Java (JDBC)

In the beginning of my study time I’ve programmed a MySQL connection in Java for a music collection. After 2 years now I have made a remake of [post id=816]this code[/post] to show how to use the Java Database Connectivity (JDBC). All you need is mysql-connector-java-5.0.8-bin.jar.

I’ve written a small sample for the connection with a WordPress database.
Connecting to a MySQL Database with Java (JDBC) weiterlesen