Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Runtime.InteropServices
- Imports System.Text
- Public Class Form1
- <DllImport("shell32", EntryPoint:="#261", CharSet:=CharSet.Unicode, PreserveSig:=False)>
- Public Shared Sub getusertilepath(username As String, whatever As UInt32, picpath As StringBuilder, maxlenght As Integer)
- End Sub
- Public Function getusertilepath(username As String) As String
- Dim name As StringBuilder
- name = New StringBuilder(1000)
- getusertilepath(username, 2147483648, name, name.Capacity)
- Return name.ToString
- End Function
- Public Function getuserpic(username As String) As Image
- Return Image.FromFile(getusertilepath(username))
- End Function
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- PictureBox1.Image = getuserpic(System.Security.Principal.WindowsIdentity.GetCurrent().Name)
- Label1.Text = Environment.UserName
- End Sub
- End Class
- https://www.youtube.com/watch?v=PPdSAVLOMa4&t=431s
- check the video for info
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement