첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

chrome.reg
0.00MB
explorer.reg
0.00MB
testproject.reg
0.00MB
TestProject.zip
0.00MB
testproject.html
0.00MB

▶ chrome.reg (크롬 브라우저 사용시)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
"ExternalProtocolDialogShowAlwaysOpenCheckbox"=dword:00000001

 

728x90

 

▶ explorer.reg (인터넷 익스플로러 브라우저 사용시)

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\ProtocolExecute\samplesystem]
"WarnOnOpen"=dword:00000000

 

반응형

 

▶ testproject.reg (실행 프로그램 등록)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\TestProject]
@="URL:TestProject Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\TestProject\DefaultIcon]

[HKEY_CLASSES_ROOT\TestProject\shell]

[HKEY_CLASSES_ROOT\TestProject\shell\Open]

[HKEY_CLASSES_ROOT\TestProject\shell\Open\command]
@="\"D:\\TestProject\\TestProject\\bin\\Debug\\net5.0-windows\\TestProject.exe\" \"%1\""

 

300x250

 

▶ testproject.html (웹 페이지)

<!DOCTYPE html>
<html>
<head>
<title>TestProject 실행하기</title>
<meta http-equiv="content-type" charset="utf-8">
</head>
<script>
function execute()
{
    var target1 = document.getElementsByName("param1")[0].value;
    var target2 = document.getElementsByName("param2")[0].value;
    var target3 = document.getElementsByName("param3")[0].value;
    var target4 = document.getElementsByName("param4")[0].value;
    var target5 = document.getElementsByName("param5")[0].value;

    location.href = "TestProject:" + "/" + target1 + "/" + target2 + "/" + target3 + "/" + target4 + "/" + target5;
}
</script>
<br>
<form name="form" style="padding-left:20px">
  항목 1 : <input type="text" name="param1" value="서울"><p />
  항목 2 : <input type="text" name="param2" value="수원"><p />
  항목 3 : <input type="text" name="param3" value="대전"><p />
  항목 4 : <input type="text" name="param4" value="광주"><p />
  항목 5 : <input type="text" name="param5" value="대구"><p />
</form>
<input type="button" name="summit" style="position:relative; left:20px; top:0px; height:30px; width:200px;" value="TestProject 실행" onclick="execute()">

 

▶ MainForm.cs

using System;
using System.Windows.Forms;
using System.Web;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : Form
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            string[] argumentArray = Environment.GetCommandLineArgs();

            if(argumentArray.Length > 1)
            {
                this.messageLabel.Text = HttpUtility.UrlDecode(argumentArray[1]);
            }
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요