feierabend

This commit is contained in:
hwd
2021-05-06 15:26:54 +02:00
parent a7d688610a
commit 69c7efd578
7 changed files with 324 additions and 2 deletions

View File

@@ -48,11 +48,16 @@
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\libs\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -80,6 +85,7 @@
<DependentUpon>Form1.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="Module1.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@@ -97,6 +103,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
@@ -115,6 +124,7 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -22,10 +22,76 @@ Partial Class Form1
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Dim ChartArea1 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea()
Dim ChartArea2 As System.Windows.Forms.DataVisualization.Charting.ChartArea = New System.Windows.Forms.DataVisualization.Charting.ChartArea()
Dim Legend1 As System.Windows.Forms.DataVisualization.Charting.Legend = New System.Windows.Forms.DataVisualization.Charting.Legend()
Dim Series1 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
Dim Series2 As System.Windows.Forms.DataVisualization.Charting.Series = New System.Windows.Forms.DataVisualization.Charting.Series()
Me.tbCoinDataURL = New System.Windows.Forms.TextBox()
Me.btnGetCoinData = New System.Windows.Forms.Button()
Me.Chart1 = New System.Windows.Forms.DataVisualization.Charting.Chart()
CType(Me.Chart1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'tbCoinDataURL
'
Me.tbCoinDataURL.Location = New System.Drawing.Point(12, 12)
Me.tbCoinDataURL.Name = "tbCoinDataURL"
Me.tbCoinDataURL.Size = New System.Drawing.Size(331, 20)
Me.tbCoinDataURL.TabIndex = 0
Me.tbCoinDataURL.Text = "https://www.hirnwun.de:4555/c/getCoinData.php"
'
'btnGetCoinData
'
Me.btnGetCoinData.Location = New System.Drawing.Point(349, 10)
Me.btnGetCoinData.Name = "btnGetCoinData"
Me.btnGetCoinData.Size = New System.Drawing.Size(75, 23)
Me.btnGetCoinData.TabIndex = 1
Me.btnGetCoinData.Text = "get data"
Me.btnGetCoinData.UseVisualStyleBackColor = True
'
'Chart1
'
Me.Chart1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
ChartArea1.Name = "ChartArea1"
ChartArea2.Name = "ChartArea2"
Me.Chart1.ChartAreas.Add(ChartArea1)
Me.Chart1.ChartAreas.Add(ChartArea2)
Legend1.Name = "Legend1"
Me.Chart1.Legends.Add(Legend1)
Me.Chart1.Location = New System.Drawing.Point(12, 39)
Me.Chart1.Name = "Chart1"
Series1.ChartArea = "ChartArea1"
Series1.Legend = "Legend1"
Series1.Name = "Series1"
Series2.ChartArea = "ChartArea2"
Series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line
Series2.Legend = "Legend1"
Series2.Name = "LineChart"
Me.Chart1.Series.Add(Series1)
Me.Chart1.Series.Add(Series2)
Me.Chart1.Size = New System.Drawing.Size(776, 399)
Me.Chart1.TabIndex = 2
Me.Chart1.Text = "Chart1"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.Chart1)
Me.Controls.Add(Me.btnGetCoinData)
Me.Controls.Add(Me.tbCoinDataURL)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.Chart1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents tbCoinDataURL As TextBox
Friend WithEvents btnGetCoinData As Button
Friend WithEvents Chart1 As DataVisualization.Charting.Chart
End Class

120
DogeCharts/Form1.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,3 +1,49 @@
Public Class Form1
Imports System.Net
Imports System.IO
Imports System.Collections.Generic
Imports Newtonsoft.Json
Public Class Form1
Dim tblData As New DataTable
Private Sub btnGetCoinData_Click(sender As Object, e As EventArgs) Handles btnGetCoinData.Click
tblData.Columns.Add("tStamp")
tblData.Columns.Add("priceEUR")
Dim drowCoindata As DataRow = tblData.NewRow
Dim sRead As StreamReader
sRead = New StreamReader("coindata.json")
Dim rawresp As String
rawresp = sRead.ReadToEnd()
Dim jo = Newtonsoft.Json.Linq.JArray.Parse(rawresp)
Dim lastelement As Int32 = jo.Count - 1
For i As Int32 = 0 To 3 'lastelement
tblData.Rows.Add(jo(i)("tstamp"), jo(i)("bitpandaDOGE"))
Next
'Dim wReq As HttpWebRequest = DirectCast(WebRequest.Create(tbCoinDataURL.Text), HttpWebRequest)
'Dim px As IWebProxy = WebRequest.GetSystemWebProxy()
'wReq.Proxy = px
'wReq.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials
'wReq.Credentials = CredentialCache.DefaultNetworkCredentials
'Dim resp As HttpWebResponse = wReq.GetResponse
End Sub
End Class

75
DogeCharts/Module1.vb Normal file
View File

@@ -0,0 +1,75 @@
'Class Module1
' ' Create a new request to the mentioned URL.
' Dim myWebRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
' Dim myProxy As New WebProxy()
' ' Obtain the Proxy Prperty of the Default browser.
' myProxy = CType(myWebRequest.Proxy, WebProxy)
' ' Print myProxy address to the console.
' Console.WriteLine(ControlChars.Cr + "The actual default Proxy settings are {0}", myProxy.Address)
' Try
' Console.WriteLine(ControlChars.Cr + "Please enter the new Proxy Address to be set ")
' Console.WriteLine("The format of the address should be http://proxyUriAddress:portaddress")
' Console.WriteLine("Example:http://moon.proxy.com:8080")
' Dim proxyAddress As String
' proxyAddress = Console.ReadLine()
' If proxyAddress.Length = 0 Then
' myWebRequest.Proxy = myProxy
' Else
' Console.WriteLine(ControlChars.Cr + "Please enter the Credentials")
' Console.WriteLine("Username:")
' Dim username As String
' username = Console.ReadLine()
' Console.WriteLine(ControlChars.Cr + "Password:")
' Dim password As String
' password = Console.ReadLine()
' ' Create a new Uri object.
' Dim newUri As New Uri(proxyAddress)
' ' Associate the new Uri object to the myProxy object.
' myProxy.Address = newUri
' ' Create a NetworkCredential object and is assign to the Credentials property of the Proxy object.
' myProxy.Credentials = New NetworkCredential(username, password)
' myWebRequest.Proxy = myProxy
' End If
' Console.WriteLine(ControlChars.Cr + "The Address of the new Proxy settings are {0}", myProxy.Address)
' Dim myWebResponse As WebResponse = myWebRequest.GetResponse()
' ' Print the HTML contents of the page to the console.
' Dim streamResponse As Stream = myWebResponse.GetResponseStream()
' Dim streamRead As New StreamReader(streamResponse)
' Dim readBuff(256) As [Char]
' Dim count As Integer = streamRead.Read(readBuff, 0, 256)
' Console.WriteLine(ControlChars.Cr + "The contents of the Html pages are :")
' While count > 0
' Dim outputData As New [String](readBuff, 0, count)
' Console.Write(outputData)
' count = streamRead.Read(readBuff, 0, 256)
' End While
' ' Close the Stream object
' streamResponse.Close()
'streamRead.Close()
'' Release the HttpWebResponse Resource.
' myWebResponse.Close()
' Console.WriteLine(ControlChars.Cr + "Press any key to continue.........")
' Console.Read()
' Catch e As UriFormatException
' Console.WriteLine(ControlChars.Cr + "{0}", e.Message)
' Console.WriteLine(ControlChars.Cr + "The format of the myProxy address you entered is invalid")
' End Try
'End Class

1
DogeCharts/coinData.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="106.11.7" targetFramework="net461" />
</packages>