"C #" specifies the process shutdown & WiFi sharing under the flash

Source: Internet
Author: User

The SingleNet.exe process attached to the flash will need to be closed first in the current version of the newsletter.

Finding the specified process in a dense list of processes is a very good test of eyesight (even if you press ' s ' to locate it is dazzling enough).

This way it takes a few minutes to write a little tool for the end of the process and share it here.

GitHub source program (project file): Https://github.com/Blz-Galaxy/KillSX

Because the main function uses a parameter list, it is good to add the name of the process to be ended in the shortcut.

C # implementation

Very simple lines of code

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Diagnostics;usingSystem.Windows.Forms;namespacekillsx{classkillsx { Public intGetprocessinfo (stringProcessName) {MessageBox.Show ("is looking for"+ProcessName); Process[] Processes=Process.getprocessesbyname (ProcessName); foreach(Process instanceinchprocesses) {                Try                {                    if(instance. ProcessName = =ProcessName)returninstance.                Id; }                Catch { }            }            return-1; }        #regionEnd the specified process///          ///end the specified process///          ///process ID for processes         Public Static voidEndprocess (intpid) {            if(PID = =-1) {MessageBox.Show ("The specified program could not be found! "); return; }            Try{Process Process=Process.getprocessbyid (PID); Process.                Kill (); MessageBox.Show ("successfully closed the specified program! "); }            Catch { }        }        #endregion        Static voidMain (string[] args) {killsx k=Newkillsx (); intShanxun = K.getprocessinfo (args[0]);        Endprocess (Shanxun); }    }}

WiFi Shared Next

Windows Console directives (can be run directly as bat files):

The first time you need to set your own SSID and password, etc.

Netsh wlan set hostednetwork mode=allow ssid=blz-galaxy key=123456789a

Turn on the virtual network card

Netsh wlan start hostednetwork

Turn off the virtual network card

Netsh wlan stop hostednetwork

Finally, you will need to manually share the Flash connection in the network connection to the Microsoft Virtual WiFi miniport Adapter that comes with Windows

"C #" specifies the process shutdown & WiFi sharing under the flash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.