증상 : 비주얼스튜디오 실행시 (실행혹은 디버깅시) 개발중 툴자체에서 포커스를 전체적으로 계속 1초간격으로 잃는것이였다.


비주얼스튜디오가 켜있는동안 다른 원도우 모든작업들이 그랬다 / 가끔은 비주얼스튜디오를 종료한뒤에도 계속 그랬다.




해결방법





이벤트 뷰어 에서 오류나는사항 체크 ...


발견 


"VPWalletLauncherC.exe"
"VPWalletService.exe"



해결법 찾아서 완료







동일한 문제는 아니지만 해결법은 동일하게 완료


---------------------------------------------------------------------------------


주소 : http://blog.lovecoco.net/category/3

   

어제 모 대형 쇼핑몰에서 결제를 하다가 뭘 설치하길레 
뭐지?
얼마전에 결제 했을때는 설치 하지 않았는데.. 또 뭘 설치하려고 하네..
에효...국내 대형 쇼핑몰들이 이렇지.. 
하고 별 생각 없이 설치하고 결제 했는데..

이상하게 오늘 컴퓨터가 버버버버버...벅..  
그래도 구입한지는 2-3년 넘었으나, i5 CPU에, SSD와 8G RAM을 갖춘 쓸만한 노트북인데.. 이상하게 버버버버버버...벅...

작업관리자를 보니.. CPU 점유율이 4개 코어 모두 거의 90~100%..
이거 뭐지? 바이러스 인가?

하고 봤던..

"VPWalletLauncherC.exe"
"VPWalletService.exe"

요 두 녀석이 미친듯.. CPU를 먹구 있었다.. 
처음에는 바이러스라고 생각하고, 삭제를 하려고 보았는데.. 이름중에. "Service".. 그래서 혹시나 하고.. 서비스 항목을 확인했더니..

떡하니.. 서비스 항목에 등록이 되어 있넹?

그것도 이 서비스를 쇼핑몰 결제 할때도 아닌, 24시간 서비스를 돌리고 있다... 세상에....

사용자 삽입 이미지

나 원참... 기가막혀서 말도 안나온다..

"This service is developed to use ISP in Non-ActiveX environment."

자랑스럽게.. ActiveX 안쓴다고.. 적어 뒀다..
대통령께서 직접 나서서 ActiveX를 없애고, 쉽게 결제 가능하도록 시스템을 개선하라고 누차 이야기 하니깐..

ActiveX를 없애고 우리는 EXE를 사용해~  라고. 자랑스럽게 이야기 한다...
EXE는 쓰지 말라고 안했으니, 사용자 PC에 깔아서 쓰자.. 
이런식으로 해결 하고 있다..

정말 뭐가 문제이고.. 왜 대통령까지 나서서 이런 이야기를 하는지 이해를 못하고 있는 ISP 업체들이 답답하다.

이러니 우리들이 한국 온라인 시장을 점점 멀리하고 해외 시장을 이용하려고 하지..

어서 PayPal 같은 해외 결제 시스템이 빨리 국내에 도입되어야 저런 찌질한 업체들이 사라질텐데..

해결 방법..

제어판 - 관리도구 - 서비스 - VPWallet 을 찾아 
사용 -> 중지 로 변경
자동 -> 수동 으로 변경.

마음같이서는 삭제 하고 싶었으나,.. 가끔 어쩔수 없이 이용하는 온라인 결제때문에.. 삭제는 못했다..

이런 나같은 호갱들 때문에 저런 찌질한 업체들이 먹구 사는 건가...



Posted by 요지
,

출처 : https://stackoverflow.com/questions/15239946/popup-window-webbrowser-control




 DLL 추가 







public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        // this assumes that you've added an instance of WebBrowser and named it webBrowser to your form
        SHDocVw.WebBrowser_V1 axBrowser = (SHDocVw.WebBrowser_V1)webBrowser.ActiveXInstance;

        // listen for new windows
        axBrowser.NewWindow += axBrowser_NewWindow;
    }

    void axBrowser_NewWindow(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed)
    {
        // cancel the PopUp event
        Processed = true;

        // send the popup URL to the WebBrowser control
        webBrowser.Navigate(URL);
    }
}



Posted by 요지
,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
 
drop function [dbo].[fn_convert24DataTime] 
go
Create FUNCTION [dbo].[fn_convert24DataTime] (@time varchar(200))
RETURNS datetime
AS
BEGIN
 
declare @result varchar(200)
 
declare @날짜 varchar(200= @time
 
set @result = (SELECT 
    case when CHARINDEX('후', @날짜,1> 0  then
        dateadd(hh, 12,  cast(replace(replace(@날짜, '오전 '''), '오후 ''') as datetime) )
    else
        cast(replace(replace(@날짜, '오전 '''), '오후 ''') as datetime)
    end As [24H]
)
 
return convert(datetime, @result)
 
End
go
 
 
select dbo.fn_convert24DataTime('2017-06-30 오후 9:33:25')
 
--결과  2017-06-30 21:33:00.000
 
 
cs


Posted by 요지
,

Start a new process and Killing the current process




Q. A프로그램에서 A프로그램을 죽이고 B프로그램을 실행하고싶다



A. 


이렇게처음에 짠코드를


//Start the BT Setup Process
ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\TEST\B.exe");
Process.Start(startInfo);

//Terminate the FSA 
Process[] myProcess = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
foreach (Process process in myProcess)
{
    process.CloseMainWindow();
    //all the windows messages has to be processed in the msg queue
    //hence call to Application DoEvents forces the MSG
    Application.DoEvents();
}




이렇게 변경해주었다.


Process.Start("A.exe");
Process.GetCurrentProcess().Kill(); // or Application.Exit(); or anything else


Posted by 요지
,

출처 : http://okgood0412.tistory.com/entry/C-WebBrowser-version-%EB%B3%80%EA%B2%BD










Visual Studio C#에서 기본 제공하는 WebBrowser 컴포넌트는 구 버전인 Internet Explorer 7 엔진을 사용 하므로, 차세대 웹 기술인 HTML5 또는 Google map v3 최신 버전 등을 지원하지 못하는 문제가 있다. 


구글링으로 알아본 바로, 해결 방법으로는 3 party component 를 사용는 방법과 프로그램에 Registry 를 조작하는 코드를 심어 놓고 프로그램 구동시 설치된 IE버전과 같은 버전으로 셋팅하는 방법등이 있다.


두번째, Registry 조작(등록) 방법!

  - 현재 PC에 Install 된 IE 버전을 사용하도록 Registry 등록.


* Visual Studio 2015 버전 사용.

* 아래 링크를 참조 하여 테스트 하였습니다. 

1. http://stackoverflow.com/questions/23356194/cannot-force-webbrowser-control-to-render-using-current-version-of-ie


2. http://stackoverflow.com/questions/17922308/use-latest-version-of-ie-in-webbrowser-control



1. Winform Project 생성




2. Program.cs 파일에 소스추가.

  


namespace WebBrowserIEVersionTest

{

    static class Program

    {

        static Mutex mutex = new System.Threading.Mutex(false, "jMutex");


        /// <summary>

        /// The main entry point for the application.

        /// </summary>

        [STAThread]

        static void Main()

        {

            if(!mutex.WaitOne(TimeSpan.FromSeconds(2), false))

            {

                //another application instance is running

                return;

            }


            try

            {

                Application.EnableVisualStyles();

                Application.SetCompatibleTextRenderingDefault(false);


                var targetApplication = Process.GetCurrentProcess().ProcessName + ".exe";

                int browserver = 7;

                int ie_emulation = 11999;


                using (WebBrowser wb = new WebBrowser())

                {

                    browserver = wb.Version.Major;



                    if (browserver >= 11)

                        ie_emulation = 11001;

                    else if (browserver == 10)

                        ie_emulation = 10001;

                    else if (browserver == 9)

                        ie_emulation = 9999;

                    else if (browserver == 8)

                        ie_emulation = 8888;

                    else

                        ie_emulation = 7000;

                }


                try

                {

                    //string tmp = Properties.Settings.Default.Properties.

                    SetIEVersioneKeyforWebBrowserControl(targetApplication, ie_emulation);

                    Application.Run(new Form1());


                }

                catch (Exception ex1)

                {


                }


            }

            catch (Exception ex2)

            {


                

            } finally

            {

                mutex.ReleaseMutex();

            }            

        }


        private static void SetIEVersioneKeyforWebBrowserControl(string appName, int ieval)

        {

            RegistryKey Regkey = null;

            try

            {

                Regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true);


                //If the path is not correct or 

                //If user't have priviledges to access registry 

                if (Regkey == null)

                {

                    MessageBox.Show("Application FEATURE_BROWSER_EMULATION Failed - Registry key Not found");

                    return;

                }


                string FindAppkey = Convert.ToString(Regkey.GetValue(appName));


                //Check if key is already present 

                if (FindAppkey == ieval.ToString())

                {

                    MessageBox.Show("Application FEATURE_BROWSER_EMULATION already set to " + ieval);

                    Regkey.Close();

                    return;

                }


                //If key is not present or different from desired, add/modify the key , key value 

                Regkey.SetValue(appName, unchecked((int)ieval), RegistryValueKind.DWord);


                //check for the key after adding 

                FindAppkey = Convert.ToString(Regkey.GetValue(appName));


                if (FindAppkey == ieval.ToString())

                {

                    MessageBox.Show("Application FEATURE_BROWSER_EMULATION changed to " + ieval + "; changes will be visible at application restart");

                }

                else

                {

                    MessageBox.Show("Application FEATURE_BROWSER_EMULATION setting failed; current value is  " + ieval);

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show("Application FEATURE_BROWSER_EMULATION setting failed; " + ex.Message);

            }

            finally

            {

                //Close the Registry 

                if (Regkey != null)

                    Regkey.Close();

            }

        }

    }

}


3. 실행결과.

  - 처음 실행시, 변경 됐음을 알림.


  - 동일한 프로그램 재 실행시 이미 변경되었다고 알림.


  - 기존 Default 버전 WebBrowser component 에서 발생했던 Script error가 이 방법을 통해 나타나지 않는것을 확인함!! 



Posted by 요지
,