Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HHU_CampusNetwork_AutoLogin

A lightweight, silent Windows utility that automatically handles the captive portal login for the Hohai University network.

Installs as a background service that triggers on network connection, so you're always online.

Features

  • Install & Forget: Runs automatically when you connect to the target Wi-Fi.
  • Credentials on Install: Securely asks for your username and password during installation.
  • Silent Background Operation: Runs invisibly with no console window (unless DEBUG is enabled).
  • Smart Trigger: Uses the Windows Event Log (Event ID 10000) to run after the network connection is stable, not before.
  • Configurable: All settings (username, password, SSID, debug mode) are stored in a simple .env file.
  • Proper Uninstaller: Includes a full uninstaller in "Add or remove programs."

Installation

  1. Download the latest HohaiAutoLogin_Setup.exe from the Releases page.
  2. Run the installer. It will request Administrator privileges, which are required to create the auto-run task.
  3. On the "Enter Credentials" page, type in your portal username (Student ID) and password.
  4. On the "Components" page, ensure "Run automatically on network connection" is checked.
  5. Complete the installation.

That's it! The next time you connect to the "Hohai University" network, the script will run automatically in the background and log you in.

How It Works

The installer places HohaiAutoLogin.exe and a .env config file in <Your installation directory>\HohaiAutoLogin.

If you select the "auto-run" option, it creates a Windows Scheduled Task. This task does not run on a timer. Instead, it listens for a specific system event: Event ID 10000 from the Microsoft-Windows-NetworkProfile/Operational log. This event is fired by Windows the moment it successfully identifies a new network connection, making it the perfect trigger.

When triggered, the executable reads its configuration from the .env file in its own directory and performs the login.

Configuration & Troubleshooting

After installation, you can modify your settings by editing the .env file located in the installation directory (e.g., C:\Program Files\HohaiAutoLogin\.env).

# --- HohaiAutoLogin Configuration ---
# This file is auto-generated by the installer.

# Broadband Account (Student ID)
PORTAL_USERNAME=your_username_was_saved_here

# Broadband Password
PORTAL_PASSWORD=your_password_was_saved_here

# (Optional) Service provider name
## This value was obtained by reverse engineering the value of the relevant element (named net_access_type) in the official HTML source code.
## As of November 9, 2025, only the following values ​​are available.
## Optional values:
##   1. 移动  ->SERVICE_NAME=中国移动(CMCC NET)
##   2. 电信  ->SERVICE_NAME=中国电信(常州)
##   3. 联通  ->SERVICE_NAME=中国联通(常州)
##   4. 校园网->SERVICE_NAME=校园外网服务(out-campus NET)
## e.g., if your service is 移动:SERVICE_NAME=中国移动(CMCC NET)
SERVICE_NAME=中国移动(CMCC NET)

# (Optional) Target Wi-Fi SSID
TARGET_SSID="Hohai University"

# (Optional) Set to "true" to show the console window for debugging
DEBUG=False

About

Hohai University Campus Network Automatic Login Program

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages