Power BI

Content by Charles Sterling

Code from one of my .NET Essentials modules

When i did my last .NET Essentials course i walked the students through zones and CAS and used the following code that wasn’t in the manuals….

TextBox1.Text = Security.Policy.Zone.CreateFromUrl(Application.ExecutablePath).SecurityZone.ToString + ” <<This Apps Zone!”

Dim stream As New IO.StreamReader(“c:\test.txt”)
TextBox1.Text = stream.ReadLine()

TextBox1.Text = System.Environment.GetEnvironmentVariable(“UserName”).ToString

Dim op As New Windows.Forms.OpenFileDialog
        Dim mystream As IO.Stream = op.OpenFile()
        Dim bytes(22) As Byte
        mystream.Read(bytes, 0, bytes.Length)
        TextBox1.Text = System.Text.Encoding.ASCII.GetString(bytes)