Microsoft MVP성태의 닷넷 이야기
아무리 고민해도 답이 안나와서.. 질문 드립니다 [링크 복사], [링크+제목 복사]
조회: 10282
글쓴 사람
heyhey
홈페이지
첨부 파일
 

asp.net으로 작성///////////////// vb.net으로 작성////////////////////////////////////// vb.net으로 작성
<3000번 포트>/////////////////////<3001번 포트>/////////////////////////////////////// <3002번 포트>
default.aspx 포털사이트에서 -> WindowsApplication2 (버튼 이용해서 Clickonce 실행) -> WindowsApplication1을 실행하려고 합니다.


=========================================================================================================================

실행은 무지 잘됩니다.
그런데 default.aspx부터 parameter를 WindowsApplication1 까지 넘겨야하는데
WindowsApplication2 까지는 잘 받았는데 그 이후가 넘어가질 않습니다.

WindowsApplication2에서

Private Sub GetUrlParameters()

        ' ClickOnceアプリの場合のときのみ以下のコ?ドを?行

        If ApplicationDeployment.IsNetworkDeployed = False Then
           Return
        End If

        ' 起動URLを取得
        Dim url As String = _
          ApplicationDeployment.CurrentDeployment.ActivationUri.AbsoluteUri
        ' クエリ部分を抽出
        Dim myUri As Uri = New Uri(url)
        Dim queryString As String = myUri.Query
        If String.IsNullOrEmpty(queryString) Then
            Return
        End If

        Dim userName As String = "ログイ"
        Dim message As String = "端末名"
        Dim nameValuePairs() As String = queryString.Split("&"c)
        For Each pair As String In nameValuePairs
            Dim vars() As String = pair.Split("="c)
            If vars.Length <> 2 Then
                Continue For
            End If
            vars(0) = vars(0).Replace("?", "") ' “?”は削る
            If String.Compare(vars(0), "userName", True) = 0 Then
                userName = HttpUtility.UrlDecode(vars(1))
            ElseIf String.Compare(vars(0), "message", True) = 0 Then
                message = HttpUtility.UrlDecode(vars(1))
            End If
        Next
        MessageBox.Show(userName & ", " & message)
        '各パラメ?タを分離して抽出()
    End Sub

parameter 받고 버튼 생성 후

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim myProcess As Process
        myProcess = System.Diagnostics.Process.Start("Calc.exe")
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim strArgList As String
        strArgList = "http://192.168.11.67:3002/WindowsApplication1.application?"

        Dim userName As String = "Owner"
        Dim message As String = "Hello World"

        strArgList = strArgList & "userName=" & userName & "&message=" & message
        Dim browser As New System.Windows.Forms.WebBrowser
        browser.Url = New System.Uri(strArgList)
    End Sub

WindowsApplication1 로 넘겼습니다.

WindowsApplication1까진 잘 실행이 되는데 parameter를 받으려고 똑같이

Private Sub GetUrlParameters()

        ClickOnceアプリの場合のときのみ以下のコ?ドを?行

        If ApplicationDeployment.IsNetworkDeployed = False Then
           Return
        End If

        ' 起動URLを取得
        Dim url As String = _
          ApplicationDeployment.CurrentDeployment.ActivationUri.AbsoluteUri
        ' クエリ部分を抽出
        Dim myUri As Uri = New Uri(url)
        Dim queryString As String = myUri.Query
        If String.IsNullOrEmpty(queryString) Then
            Return
        End If

        Dim userName As String = "ログイ"
        Dim message As String = "端末名"
        Dim nameValuePairs() As String = queryString.Split("&"c)
        For Each pair As String In nameValuePairs
            Dim vars() As String = pair.Split("="c)
            If vars.Length <> 2 Then
                Continue For
            End If
            vars(0) = vars(0).Replace("?", "") ' “?”は削る
            If String.Compare(vars(0), "userName", True) = 0 Then
                userName = HttpUtility.UrlDecode(vars(1))
            ElseIf String.Compare(vars(0), "message", True) = 0 Then
                message = HttpUtility.UrlDecode(vars(1))
            End If
        Next
        MessageBox.Show(userName & ", " & message)
        '各パラメ?タを分離して抽出()
    End Sub

작성하였는데 실행이 안됩니다.

If ApplicationDeployment.IsNetworkDeployed = False Then
      Return
End If

이 구문부터 오류가 나기 시작합니다. 어떻게 해야하나요 성태님








[최초 등록일: ]
[최종 수정일: 6/30/2017]


비밀번호

댓글 작성자
 



2017-07-02 01시53분
마지막에 오류가 난다는 것이 구체적으로 어떤 오류인지 써주세요. 최대한 자세한 정보를 써 주는 것이 좋습니다.
정성태

1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5648주니어개...4/13/20223866컴파일된 코드를 원시코드로 바꾸려면 어떻게해야하나요? [1]파일 다운로드1
5647장성욱4/7/20223911코어지정 CPU사용률 관련 질문 [1]
5646서형주4/6/20223940List에 여러개의 class 객체를 만들어 넣을때, 객체의 method들도 같이 생성되어 메모리를 차지하나요? [1]
5645김인태4/6/20223576윈도우즈 서버의 AD 계정 생성 조건이 있을까요? [1]
5644ㅇㅇ4/6/20224333c# 프로그램을 이용하여 리눅스상에 파일 생성이 가능한가요? [1]
5643유필재4/5/20224200TCP클라이언트 연결 및 통신관련하여 문의드려요 [1]
5642차가워4/4/20224448UdpClient 패킷 수신 문의 [4]
5641장성욱4/4/20224860코어 할당 및 cpu 부하테스트 질문 [7]
5640icoo...4/4/20224400웹가든에서 메모리 동적 업데이트 방법 [1]
5639차가워4/4/20224295c++ 서버 c# 클라이언트 호환 문의 [1]
5638초급4/3/20224595c# sql server 연동 [1]
5637따봉이4/1/20224857Winform Form Load 후 자동 캡쳐관련 [1]파일 다운로드1
5636김철순3/31/20224844WPF에서 Richtext의 View 문의 [5]
5635guest3/30/20224870안정적인 pinning이 가능하네요. [3]파일 다운로드1
5633꿀주세요3/30/20224516선생님 마우스 클릭이벤트 질문이 있습니다. [4]
5632김현수3/30/20224848Remote Desktop으로 접속시 WPF UI 가 다시 그려지는 이벤트를 막을 수 없을까요? [3]
5631김기헌3/24/20224475WPF 컨트롤의 그래픽 처리관련 질문드립니다 [2]파일 다운로드1
5630장성욱3/24/20224302로깅관련 질문입니다. [2]
5629감사합니...3/23/20224559함수에서 예외가 발생하면 try ~ catch처리기를 찾을 때 까지 상위 함수로 계속 올라가나요? [2]
5628홍길동3/23/20225199질문드립니다. [2]파일 다운로드1
5626연준혁3/21/20224428안녕하세요. [3]
5625jaew...3/18/20225362c# 8.0 도서를 구입한 사람입니다. [1]
5624초보자3/17/20224328람다 캡처 관련 문의 [2]
5623한예지 donator3/15/20224703인터프리터 원리가 궁금합니다. [4]
5622김민아3/8/20224638const와 readonly의 명확한 차이가 이게 맞나요? [2]
5621장성욱3/8/20224445c# 로그 관련 질문 [1]
1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  ...