C\#에서 명령 행 cmd 를 호출 하여 와 이 파이 핫 이 슈 를 여 는 인 스 턴 스 코드
요점 1:cmd 명령 줄 의 입력 명령 netsh wlan set hostednetwork mode=allow ssid=사용자 이름 key=암호 netsh wlan start hostednetwork netsh waln stop hostednetwork netsh interface ip set address name="로 컬 연결"source=dhcp
요점 2:C\#에서 cmd.exe 명령 행 호출
private void create(string str)
{
//process
System.Diagnostics.Process p = new System.Diagnostics.Process();
// cmd.exe
p.StartInfo.FileName = "cmd.exe";
//
p.StartInfo.UseShellExecute = false;
//
//
p.StartInfo.RedirectStandardInput = true;
//
p.StartInfo.RedirectStandardOutput = true;
//
p.StartInfo.RedirectStandardError = true;
//
p.StartInfo.CreateNoWindow = true;
//
p.Start();
// 1s。
System.Threading.Thread.Sleep(1000);
//
p.StandardInput.WriteLine(str);
// 。
p.StandardInput.WriteLine("exit");
}
상세 한 코드 는 다음 과 같다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
IOS가 현재 네트워크 상태를 판단하는 세 가지 방법을 자세히 설명합니다.프로젝트에서 좋은 사용자 체험을 위해 일부 장면은 반드시 네트워크 상태를 라인으로 판단한 후에야 무엇을 해야 할지 결정할 수 있다.예를 들어 영상 재생은 와이파이인지 4G인지 선이 판단해야 한다. 와이파이가 직접 재...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.