Änderung der Logik der Vollmachtsverwaltung im Kunden (nun können pro VM-Typ mehrere Vollmachten hinterlegt werden). Weiters wurde die GUI der Vollmachten überarbeitet
This commit is contained in:
43
_VERAG_PROG_ALLGEMEIN/Schnittstellen/cJsonPost.vb
Normal file
43
_VERAG_PROG_ALLGEMEIN/Schnittstellen/cJsonPost.vb
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
Imports Newtonsoft.Json
|
||||
Imports System.Net
|
||||
Imports System.Text
|
||||
|
||||
|
||||
Public Class cJsonPost
|
||||
|
||||
|
||||
' Dim jsonPost As New JsonPost("http://192.168.254.104:8000")
|
||||
' Dim dictData As New Dictionary(Of String, Object)
|
||||
'dictData.Add("test_key", "test_value")
|
||||
'jsonPost.postData(dictData)
|
||||
|
||||
|
||||
|
||||
Private urlToPost As String = ""
|
||||
|
||||
Public Sub New(ByVal urlToPost As String)
|
||||
Me.urlToPost = urlToPost
|
||||
End Sub
|
||||
|
||||
Public Function postData(ByVal dictData As Dictionary(Of String, Object)) As Boolean
|
||||
Dim webClient As New WebClient()
|
||||
Dim resByte As Byte()
|
||||
Dim resString As String
|
||||
Dim reqString() As Byte
|
||||
|
||||
Try
|
||||
webClient.Headers("content-type") = "application/json"
|
||||
reqString = Encoding.Default.GetBytes(JsonConvert.SerializeObject(dictData, Formatting.Indented))
|
||||
resByte = webClient.UploadData(Me.urlToPost, "post", reqString)
|
||||
resString = Encoding.Default.GetString(resByte)
|
||||
Console.WriteLine(resString)
|
||||
webClient.Dispose()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Console.WriteLine(ex.Message)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user