17 Ağustos 2013 Cumartesi
Windows Ortam Bilgileri Projesi
WINDOWS ORTAM BİLGİLERİ PROJE KODLARI
İNDİR
02.09.2013
Imports System.IO Imports System.Environment Public Class AnaFrm #Region " FORM OLAYLARI.." Private Sub AnaFrm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ListeYukle(OzelKlasörListesi, GetType(Environment.SpecialFolder)) ListeYukle(OrtamDegiskenListesi, GetEnvironmentVariables.Keys) OzellikleriOku() MetotUygula() SistemBilgileriniYukle() End Sub #End Region #Region " Enum (Sıralama) İşleme..." Private Sub ListeYukle(ByVal lst As ListBox, ByVal typ As Type) lst.DataSource = System.Enum.GetNames(typ) End Sub Private Function GetSpecialFolderFromList() As Environment.SpecialFolder Return CType(System.Enum.Parse(GetType(Environment.SpecialFolder), _ OzelKlasörListesi.SelectedItem.ToString), Environment.SpecialFolder) End Function Private Sub ListeYukle(ByVal lst As ListBox, ByVal ic As ICollection) Dim astrItems(ic.Count - 1) As String ic.CopyTo(astrItems, 0) lst.DataSource = astrItems End Sub #End Region Private Sub TempDegAlBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TempDegAlBtn.Click lblTEMP.Text = Environment.GetEnvironmentVariable("TEMP") System.Diagnostics.Process.Start("explorer.exe", lblTEMP.Text) End Sub Private Sub BtnYenile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnYenile.Click LblSure.Text = Environment.TickCount.ToString End Sub Private Sub GuncelIzlemeBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GuncelIzlemeBtn.Click Try MsgBox(Environment.StackTrace, MsgBoxStyle.OkOnly, Me.Text) Catch exp As System.Security.SecurityException MsgBox("Bir güvenlik özel durumu oluştu." & vbCrLf & exp.Message, MsgBoxStyle.Critical, exp.Source) Catch exp As System.Exception MsgBox("Beklenmeyen bir erişim hatası (StackTrace) oluştu." & vbCrLf & exp.Message, MsgBoxStyle.Critical, exp.Source) End Try End Sub Private Sub OrtamDegiskenListesi_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrtamDegiskenListesi.SelectedIndexChanged Dim str As String = GetEnvironmentVariable(OrtamDegiskenListesi.SelectedItem.ToString) '"C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Broadcom\Broadcom 802.11\Driver;C:\Program Files\Windows Live\Shared;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Common Files\Acronis\SnapAPI\;C:\Program Files\Acronis\BackupAndRecovery\" 'ListBox1.Items.AddRange(str.Split(";")) 'veya 'ListBox1.DataSource = str.Split(";") CevreDegiskenTxt.Lines = str.Split(CChar(";")) End Sub Private Sub KlasörListesi_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OzelKlasörListesi.SelectedIndexChanged Dim sf As Environment.SpecialFolder sf = GetSpecialFolderFromList() If OzelKlasörListesi.Text = "MyComputer" Then OzelKlasorLbl.Text = "explorer.exe" & "," & "/e" & ",/select,c:" Exit Sub End If OzelKlasorLbl.Text = GetFolderPath(sf) End Sub Private Sub lvwSystemInformation_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SysBilgisiLW.Resize SysBilgisiLW.Columns(1).Width = _ SysBilgisiLW.ClientRectangle.Width - SysBilgisiLW.Columns(0).Width End Sub Private Sub OzellikleriOku() LblCalismaAYari.Text = Environment.WorkingSet.ToString lblVersiyon.Text = Environment.Version.ToString LblKullAdi.Text = Environment.UserName LblKullAlanAdi.Text = Environment.UserDomainName LblSure.Text = Environment.TickCount.ToString LblSysDizini.Text = Environment.SystemDirectory LblOSVersiyon.Text = Environment.OSVersion.ToString LblMakinaAdi.Text = Environment.MachineName LblSimdikiDizin.Text = Environment.CurrentDirectory LblKmtSatiri.Text = Mid(Environment.CommandLine, 2, Len(Environment.CommandLine)) End Sub Private Sub SistemBilgileriniYukle() With SysBilgisiLW.Items.Add("ArrangeDirection" & "- (Yön)") .SubItems.Add(SystemInformation.ArrangeDirection.ToString()) End With With SysBilgisiLW.Items.Add("ArrangeStartingPosition" & "- (Başlangıç Yeri)") .SubItems.Add(SystemInformation.ArrangeStartingPosition.ToString()) End With With SysBilgisiLW.Items.Add("BootMode" & "- (Boot Modu)") .SubItems.Add(SystemInformation.BootMode.ToString()) End With With SysBilgisiLW.Items.Add("Border3DSize" & "- (Kenar Boyutu)") .SubItems.Add(SystemInformation.Border3DSize.ToString()) End With With SysBilgisiLW.Items.Add("BorderSize") .SubItems.Add(SystemInformation.BorderSize.ToString()) End With With SysBilgisiLW.Items.Add("CaptionButtonSize" & "- (Başlık buton boyu)") .SubItems.Add(SystemInformation.CaptionButtonSize.ToString()) End With With SysBilgisiLW.Items.Add("CaptionHeight" & "- (Başlık Boyu)") .SubItems.Add(SystemInformation.CaptionHeight.ToString()) End With With SysBilgisiLW.Items.Add("ComputerName" & "- (Bilgisayar Adı)") .SubItems.Add(SystemInformation.ComputerName.ToString()) End With With SysBilgisiLW.Items.Add("CursorSize" & "- (İmleç Boyu)") .SubItems.Add(SystemInformation.CursorSize.ToString()) End With With SysBilgisiLW.Items.Add("DbcsEnabled" & "- (dbcs Etkin)") .SubItems.Add(SystemInformation.DbcsEnabled.ToString()) End With With SysBilgisiLW.Items.Add("DebugOS" & "- (OS Hata Ayıklama)") .SubItems.Add(SystemInformation.DebugOS.ToString()) End With With SysBilgisiLW.Items.Add("DoubleClickSize" & "- (ÇitTıklama Boyutu)") .SubItems.Add(SystemInformation.DoubleClickSize.ToString()) End With With SysBilgisiLW.Items.Add("DoubleClickTime" & "- (ÇitTıklama Süresi)") .SubItems.Add(SystemInformation.DoubleClickTime.ToString()) End With With SysBilgisiLW.Items.Add("DragFullWindows" & "- (Tam Penc.Sürükle)") .SubItems.Add(SystemInformation.DragFullWindows.ToString()) End With With SysBilgisiLW.Items.Add("DragSize" & "- (Sürükleme boyutu)") .SubItems.Add(SystemInformation.DragSize.ToString()) End With With SysBilgisiLW.Items.Add("FixedFrameBorderSize" & "- (Sabit Çrç.Boyutu)") .SubItems.Add(SystemInformation.FixedFrameBorderSize.ToString()) End With With SysBilgisiLW.Items.Add("FrameBorderSize" & "- (Çerçeve Sınır Boyutu)") .SubItems.Add(SystemInformation.FrameBorderSize.ToString()) End With With SysBilgisiLW.Items.Add("HighContrast" & "- (Yüksek Kontrast)") .SubItems.Add(SystemInformation.HighContrast.ToString()) End With With SysBilgisiLW.Items.Add("HorizontalScrollBarArrowWidth" & "- (Yatay Kayd.Ok Çbk.Genişliği)") .SubItems.Add(SystemInformation.HorizontalScrollBarArrowWidth.ToString()) End With With SysBilgisiLW.Items.Add("HorizontalScrollBarHeight" & "- (Yatay kayd.çbk Yüks.)") .SubItems.Add(SystemInformation.HorizontalScrollBarHeight.ToString()) End With With SysBilgisiLW.Items.Add("HorizontalScrollBarThumbWidth" & "- (Yatay Kayd.Çbk Düğme Eni)") .SubItems.Add(SystemInformation.HorizontalScrollBarThumbWidth.ToString()) End With With SysBilgisiLW.Items.Add("IconSize" & "- (İkon Boyu)") .SubItems.Add(SystemInformation.IconSize.ToString()) End With With SysBilgisiLW.Items.Add("IconSpacingSize" & "- (İkon Boyutu)") .SubItems.Add(SystemInformation.IconSpacingSize.ToString()) End With With SysBilgisiLW.Items.Add("KanjiWindowHeight" & "- (Pencere Yüksekliği)") .SubItems.Add(SystemInformation.KanjiWindowHeight.ToString()) End With With SysBilgisiLW.Items.Add("MaxWindowTrackSize" & "- (Max Pencere Boyutu)") .SubItems.Add(SystemInformation.MaxWindowTrackSize.ToString()) End With With SysBilgisiLW.Items.Add("MenuButtonSize" & "- (Menu Btn Boyutu)") .SubItems.Add(SystemInformation.MenuButtonSize.ToString()) End With With SysBilgisiLW.Items.Add("MenuCheckSize" & "- (Menu Ctl Boyu)") .SubItems.Add(SystemInformation.MenuCheckSize.ToString()) End With With SysBilgisiLW.Items.Add("MenuFont" & "- (Menu Font)") .SubItems.Add(SystemInformation.MenuFont.ToString()) End With With SysBilgisiLW.Items.Add("MenuHeight" & "- (Menu Boyu)") .SubItems.Add(SystemInformation.MenuHeight.ToString()) End With With SysBilgisiLW.Items.Add("MidEastEnabled" & "- (OD.Etkin)") .SubItems.Add(SystemInformation.MidEastEnabled.ToString()) End With With SysBilgisiLW.Items.Add("MinimizedWindowSize" & "- (Minimize Boyutu)") .SubItems.Add(SystemInformation.MinimizedWindowSize.ToString()) End With With SysBilgisiLW.Items.Add("MinimizedWindowSpacingSize" & "- (Minimize pnc. Aralık Boyutu)") .SubItems.Add(SystemInformation.MinimizedWindowSpacingSize.ToString()) End With With SysBilgisiLW.Items.Add("MinimumWindowSize" & "- (Minimum Pnc.Boyutu)") .SubItems.Add(SystemInformation.MinimumWindowSize.ToString()) End With With SysBilgisiLW.Items.Add("MinWindowTrackSize" & "- (Min.Pnc.Parça Boyutu)") .SubItems.Add(SystemInformation.MinWindowTrackSize.ToString()) End With With SysBilgisiLW.Items.Add("MonitorCount" & "- (Monitör sayısı)") .SubItems.Add(SystemInformation.MonitorCount.ToString()) End With With SysBilgisiLW.Items.Add("MonitorsSameDisplayFormat" & "- (Ekran Formatı)") .SubItems.Add(SystemInformation.MonitorsSameDisplayFormat.ToString()) End With With SysBilgisiLW.Items.Add("MouseButtons" & "- (Fare Butonları)") .SubItems.Add(SystemInformation.MouseButtons.ToString()) End With With SysBilgisiLW.Items.Add("MouseButtonsSwapped" & "- (Fare Düğmeleri Takası)") .SubItems.Add(SystemInformation.MouseButtonsSwapped.ToString()) End With With SysBilgisiLW.Items.Add("MousePresent" & "- (Fare Mevcut )") .SubItems.Add(SystemInformation.MousePresent.ToString()) End With With SysBilgisiLW.Items.Add("MouseWheelPresent" & "- (Fare Tekerleği Mevcut)") .SubItems.Add(SystemInformation.MouseWheelPresent.ToString()) End With With SysBilgisiLW.Items.Add("MouseWheelScrollLines" & "- (Fare Tekeri Kaydırma Hatları)") .SubItems.Add(SystemInformation.MouseWheelScrollLines.ToString()) End With With SysBilgisiLW.Items.Add("NativeMouseWheelSupport" & "- (Fare Tekerlek Desteği)") .SubItems.Add(SystemInformation.NativeMouseWheelSupport.ToString()) End With With SysBilgisiLW.Items.Add("Network" & "- (Ağ)") .SubItems.Add(SystemInformation.Network.ToString()) End With With SysBilgisiLW.Items.Add("PenWindows" & "- (Win. Kalemi)") .SubItems.Add(SystemInformation.PenWindows.ToString()) End With With SysBilgisiLW.Items.Add("PrimaryMonitorMaximizedWindowSize" & "- (Monitor Max.Pencere Boyutu)") .SubItems.Add(SystemInformation.PrimaryMonitorMaximizedWindowSize.ToString()) End With With SysBilgisiLW.Items.Add("PrimaryMonitorSize" & "- (Monitör Birincil Boyutu)") .SubItems.Add(SystemInformation.PrimaryMonitorSize.ToString()) End With With SysBilgisiLW.Items.Add("RightAlignedMenus" & "- (Menüler sağa bağlantısız)") .SubItems.Add(SystemInformation.RightAlignedMenus.ToString()) End With With SysBilgisiLW.Items.Add("Secure" & "- (Güvenli)") .SubItems.Add(SystemInformation.Secure.ToString()) End With With SysBilgisiLW.Items.Add("ShowSounds" & "- (Ses göster)") .SubItems.Add(SystemInformation.ShowSounds.ToString()) End With With SysBilgisiLW.Items.Add("SmallIconSize" & "- (Küçük ikon Boyutu)") .SubItems.Add(SystemInformation.SmallIconSize.ToString()) End With With SysBilgisiLW.Items.Add("ToolWindowCaptionButtonSize" & "- (Pnc.Başlık Düğme Eni)") .SubItems.Add(SystemInformation.ToolWindowCaptionButtonSize.ToString()) End With With SysBilgisiLW.Items.Add("ToolWindowCaptionHeight" & "- (Pnc.Başlık Düğme Boyu)") .SubItems.Add(SystemInformation.ToolWindowCaptionHeight.ToString()) End With With SysBilgisiLW.Items.Add("UserDomainName" & "- (Kullanıcı Alan Adı)") .SubItems.Add(SystemInformation.UserDomainName.ToString()) End With With SysBilgisiLW.Items.Add("UserInteractive" & "- (Kullanıcı Etkileşimli)") .SubItems.Add(SystemInformation.UserInteractive.ToString()) End With With SysBilgisiLW.Items.Add("UserName" & "- (Kullanıcı Adı)") .SubItems.Add(SystemInformation.UserName.ToString()) End With With SysBilgisiLW.Items.Add("VerticalScrollBarArrowHeight" & "- (Dikey kayd.Çbk.Boyu)") .SubItems.Add(SystemInformation.VerticalScrollBarArrowHeight.ToString()) End With With SysBilgisiLW.Items.Add("VerticalScrollBarThumbHeight" & "- (Dikey kayd.Çbk.Düğme Boyu)") .SubItems.Add(SystemInformation.VerticalScrollBarThumbHeight.ToString()) End With With SysBilgisiLW.Items.Add("VerticalScrollBarWidth" & "- (Dikey kayd. Çbk Eni)") .SubItems.Add(SystemInformation.VerticalScrollBarWidth.ToString()) End With With SysBilgisiLW.Items.Add("VirtualScreen" & "- (Sanal Ekran)") .SubItems.Add(SystemInformation.VirtualScreen.ToString()) End With With SysBilgisiLW.Items.Add("WorkingArea" & "- (Çalışma Alanı)") .SubItems.Add(SystemInformation.WorkingArea.ToString()) End With End Sub Private Sub MetotUygula() MantiksalSrcListesi.DataSource = Environment.GetLogicalDrives() KomutSatirListesi.DataSource = Environment.GetCommandLineArgs() End Sub Private Sub exitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.Close() End Sub Private Sub OzelKlasörListesi_DoubleClick(sender As System.Object, e As System.EventArgs) Handles OzelKlasörListesi.DoubleClick On Error Resume Next If OzelKlasörListesi.Text = "MyComputer" Then System.Diagnostics.Process.Start("explorer.exe", "/e,/select,c:") Exit Sub End If Process.Start(OzelKlasorLbl.Text) End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click OzelKlasorLbl.Text = "explorer.exe" & "," & "/e" & ",/select,c:" System.Diagnostics.Process.Start("explorer.exe", "/e,/select,c:") End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click System.Diagnostics.Process.Start("control.exe") End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click Process.Start("control", "printers") End Sub Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click Process.Start("WinHlp32.exe") End Sub Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click System.Diagnostics.Process.Start("C:\Windows\System32\regedt32.exe") End Sub Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click 'Dim info As New ProcessStartInfo(Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "/system32/control.exe", "userpasswords") 'Process.Start(info) 'veya Process.Start("control", "userpasswords") End Sub Private Sub KomutSatirListesi_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles KomutSatirListesi.SelectedIndexChanged Dim src As String Dim Secim As Integer src = Mid(KomutSatirListesi.Text, 1, 3) If src = "C:\" Then Secim = 0 If src = "D:\" Then Secim = 1 MantiksalSrcListesi.SelectedIndex = Secim End Sub Private Sub GezginTab_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles GezginTab.SelectedIndexChanged If GezginTab.SelectedIndex = 5 Then SurucuListesi.Items.Clear() For Each Src_Bilgisi As DriveInfo In DriveInfo.GetDrives() SurucuListesi.Items.Add(Src_Bilgisi.Name) Next Src_Bilgisi SurucuListesi.SelectedIndex = 0 End If If GezginTab.SelectedIndex = 2 Then LblSonucGenislet.Text = Environment.ExpandEnvironmentVariables(txtGenislet.Text) End If End Sub Private Sub SurucuListesi_SelectedIndexChanged() Handles SurucuListesi.SelectedIndexChanged For Each ctl As Control In Me.Controls If (ctl.Name.StartsWith("lbl")) AndAlso (TypeOf ctl Is Label) Then Dim lbl As Label = DirectCast(ctl, Label) lbl.Text = "" End If Next ctl Dim Src_Bilgisi As New DriveInfo(SurucuListesi.Text) LblAdi.Text = Src_Bilgisi.Name() LblHazir.Text = Src_Bilgisi.IsReady().ToString Dim a As String = Src_Bilgisi.DriveType().ToString If Not a = "Fixed" Then LblSrcTipi.Text = Src_Bilgisi.DriveType().ToString Else LblSrcTipi.Text = Src_Bilgisi.DriveType().ToString & "(" & " sabit" & ")" End If LblKokDzn.Text = Src_Bilgisi.RootDirectory.ToString If Src_Bilgisi.IsReady() Then LblSrcFormati.Text = Src_Bilgisi.DriveFormat() TopAlanLbl.Text = "" BosAlanLbl.Text = "" If SurucuListesi.SelectedIndex = 0 Then BosAlanLbl.Text = FormatBayt(Src_Bilgisi.TotalFreeSpace, "0.00") TopAlanLbl.Text = FormatBayt(Src_Bilgisi.TotalSize, "0.00") Else TopAlanLbl.Text = FormatBayt(Src_Bilgisi.TotalSize, "0.00") BosAlanLbl.Text = FormatBayt(Src_Bilgisi.AvailableFreeSpace, "0.00") End If LblBirimEtiketi.Text = Src_Bilgisi.VolumeLabel() End If End Sub Private Function FormatBayt(ByVal BaytDrm As Double, ByVal StrFormat As String) As String Dim Cevir() As String = {"Bayt", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} For i As Integer = Cevir.Length - 1 To 0 Step -1 If BaytDrm > 1024 ^ i Then BaytDrm /= 1024 ^ i Return BaytDrm.ToString(StrFormat) & " " & Cevir(i) End If Next i Return BaytDrm.ToString(StrFormat) & " Bayt" End Function Private Sub OrtamDegiskenListesi_DoubleClick(sender As System.Object, e As System.EventArgs) System.Diagnostics.Process.Start("explorer.exe", CevreDegiskenTxt.Text) End Sub End Class
Sonraki Kayıt
Önceki Kayıt
Ana Sayfa