Microsoft MVP성태의 닷넷 이야기
아무리 고민해도 답이 안나와서.. 질문 드립니다 [링크 복사], [링크+제목 복사],
조회: 10293
글쓴 사람
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)
5781List맨1/5/20233810List.Add("newobj") 속도는 빠른 편인지요? [11]
5780임세1/3/20234414C# 프로그래밍 10 책 구매한 사람입니다. 3부 자료는 어디서 다운 받을 수 있나요? [4]
5779이건우1/2/20233290안녕하십니까 루프안에서 메세지처리에 관하여 질문드립니다! [2]
5778이건우12/30/20224572안녕하세요 c#에서 dll참조 관련 질문드립니다. [4]
5777감사합니...12/29/20223563UI Thread에 Invoke 처리관련 궁금합니다. [3]
5776pdf맨12/28/20223357C# MouseUp Event + pdf [10]
5775민성12/28/20223142안녕하세요 Class 관련해서 예외처리를 하나로 받아낼수 있는 방법 [1]
5774중급12/27/20223935중급개발자란 어느 수준인지요? [4]
5773김영식12/26/20223465c# 압축파일 읽어 올 때 BinaryRead 한글 처리 문제 [1]
5772눈송이12/26/20223596Excel VSTO 는 왜 Net Core, Net 5, 6 버전을 사용하지 않나요? [2]
5771김훈12/26/20223711c# .net client application 망분리(내부망,외부망) 환경에서 의문의 외부사이트 호출 대기 [2]
5770lsh12/26/20223308클라우디움안에 있는 파일을 File.Copy 하고싶은데 코드로는 접근을 못하나요? [1]
5769울타리12/20/20223343Active Directory 2012R2 2016 또는 2019 마이그렝션 문의 드립니다. [1]
5768c++12/14/20224098Thread를 사용한 C++ DLL에 관련된 질문입니다. [6]파일 다운로드2
5767민성12/9/20223458안녕하세요 ashx로 화일을 저장하고 화일명을 리턴하는데요 [1]
5766김명훈12/9/20223594웹브라우저에서 묻지 않고 바로 다운로드 [2]
5765hong12/1/20223839Winform(.Net6) 클라이언트에서 SignalR Core 웹서버에 접속시 인증서 문제 [3]파일 다운로드1
5764요한11/30/20224039c++ 동일한 객체인지 비교 방법문의 [2]
5763고필석11/30/20223558시작하자마자 비정상 종료하는 프로세스에 대한 문제 해결 조언 요청 드립니다. [3]
5762흰털너부리11/30/20223544wpf mvvm ui update 로딩중 표시 [1]
5761민성11/29/20223441죄송하지만 한가지만 더 여쭈어 보겠습니다 [1]
5760민성11/29/20223364안녕하세요 [2]
5759문정환11/28/20223714c# socket 통신할때 빅엔디언으로 바꿔줘야 하나요? [1]
5758라떼11/28/20224913Linux 에서 winform UI 어플리케이션 실행하기 [3]
5757흰털너부리11/25/20223869asp.net core EF AddDbContext,AddDbContextFactory 차이점 알려주세요 [1]
5756흰털너부리11/25/20223441asp.net core web api에서 json 특정 property 무시하는 방법 문의 드립니다. System.Text.Json 사용중입니다. [1]
1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...