인터넷 속도를 향상 시키는 4가지 방법

Posted by 나에요임마
2020. 5. 12. 23:30 Program/Windows

1. win + r => gpedit.msc 컴퓨터구성 / 관리템플릿 / 네트워크/ Qos 패킷 스케줄 러 /// 예약 대여폭 제한 > 사용 / 0

 

 

2. cmd에 >> ipconfig/displaydns 너무 많으면 >> ipconfig/flushdns

 

 

3. 사용중 네트워크 속성 internet Protocal Version 4 (TCP/IPv4) 다음 DNS서버주소사용 1,1,1,1 / 1,0,0,1 8,8,8,8 / 8,8,4,4 구글

 

 

4. regedit로 HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft/Windows-NT / CurrentVerwion / Multimedia / systemProfile networkthrottlingindex 46 16진수

등록된 서비스 지우기

Posted by 나에요임마
2020. 5. 10. 22:46 Program/PC etc


윈도우를 사용하면서 여러가지 프로그램을 설치하게 된다.
프로그램 재설치 및 삭제를 수행하였을 때, 간혹 서비스가 지워지지 않는 경우가 존재하는데
이 때, 목록에서 서비스 리스트를 지우는 작업에 대해 알아보자

[제어판] - [관리도구] - [서비스]를 클릭하면, 아래와 같은 서비스 목록이 나타난다.


이는 [윈도우 키 + R]을 이용한 실행을 통해서 직접 들어갈 수 있다.
아래 그림과 같이 실행 창에 명령어를 넣어보자. < services.msc >



이제 서비스 목록에서 서비스를 지우기 위한 명령어를 알아보자.
서비스는 아래와 같이 명령 프롬프트를 실행시킨 후, 명령어를 이용하여 삭제한다.
명령 프롬프트는 실행 창에서 아래와 같이 명령어를 입력하면 된다.


명령 프롬프트에서 [sc delete 서비스이름]을 입력하고 실행하면 서비스가 지워진다.
오라클을 설치했다가 지웠는데, 서비스가 지워지지 않는 경우가 가끔 있는데, 그에 해당하는 예제를 보도록 하자



맨 오른쪽에 서비스이름 부분은 위의 서비스 목록에 있는 이름을 똑같이 치면 된다.
성공하면 [SC] DeleteService SUCCESS 라는 내용이 출력된다.

서비스는 내가 설치한 프로그램이 돌아가도록 하는 것이므로 함부로 지워서는 안되겠지만,
위와 같은 상황이 발생하였을 경우, 오라클 재설치가 잘 안되는 경우가 많다.
프로그램 삭제 후 설치가 잘 안된다면, 서비스리스트를 확인한 후 서비스도 지워주자.

그렇게하면 프로그램 재 설치가 용이할 것이다.

출처: https://okjkillo.tistory.com/entry/Windows-Tips-등록된-서비스-지우기 [하루에 한가지라도 배워라]

Service Program Install

Posted by 나에요임마
2020. 5. 10. 22:44 Program/C#

1. Structure the Main() function of your service like this:

static void Main(string[] args)
{
    if (args.Length == 0) {
        // Run your service normally.
        ServiceBase[] ServicesToRun = new ServiceBase[] {new YourService()};
        ServiceBase.Run(ServicesToRun);
    } else if (args.Length == 1) {
        switch (args[0]) {
            case "-install":
                InstallService();
                StartService();
                break;
            case "-uninstall":
                StopService();
                UninstallService();
                break;
            default:
                throw new NotImplementedException();
        }
    }
}

 

 

 

 

 

 

2. Here is the supporting code:

using System.Collections;
using System.Configuration.Install;
using System.ServiceProcess;

private static bool IsInstalled()
{
    using (ServiceController controller = 
        new ServiceController("YourServiceName")) {
        try {
            ServiceControllerStatus status = controller.Status;
        } catch {
            return false;
        }
        return true;
    }
}

private static bool IsRunning()
{
    using (ServiceController controller = 
        new ServiceController("YourServiceName")) {
        if (!IsInstalled()) return false;
        return (controller.Status == ServiceControllerStatus.Running);
    }
}

private static AssemblyInstaller GetInstaller()
{
    AssemblyInstaller installer = new AssemblyInstaller(
        typeof(YourServiceType).Assembly, null);
    installer.UseNewContext = true;
    return installer;
}

 

 

 

 

 

 

3. Continuing with the supporting code..

private static void InstallService()
{
    if (IsInstalled()) return;

    try {
        using (AssemblyInstaller installer = GetInstaller()) {
            IDictionary state = new Hashtable();
            try {
                installer.Install(state);
                installer.Commit(state);
            } catch {
                try {
                    installer.Rollback(state);
                } catch { }
                throw;
            }
        }
    } catch {
        throw;
    }
}

private static void UninstallService()
{
    if ( !IsInstalled() ) return;
    try {
        using ( AssemblyInstaller installer = GetInstaller() ) {
            IDictionary state = new Hashtable();
            try {
                installer.Uninstall( state );
            } catch {
                throw;
            }
        }
    } catch {
        throw;
    }
}

private static void StartService()
{
    if ( !IsInstalled() ) return;

    using (ServiceController controller = 
        new ServiceController("YourServiceName")) {
        try {
            if ( controller.Status != ServiceControllerStatus.Running ) {
                controller.Start();
                controller.WaitForStatus( ServiceControllerStatus.Running, 
                    TimeSpan.FromSeconds( 10 ) );
            }
        } catch {
            throw;
        }
    }
}

private static void StopService()
{
    if ( !IsInstalled() ) return;
    using ( ServiceController controller = 
        new ServiceController("YourServiceName")) {
        try {
            if ( controller.Status != ServiceControllerStatus.Stopped ) {
                controller.Stop();
                controller.WaitForStatus( ServiceControllerStatus.Stopped, 
                     TimeSpan.FromSeconds( 10 ) );
            }
        } catch {
            throw;
        }
    }
}