Dim CalculatedSize As Decimal
Dim TheSize As Long = Long.Parse(My.Computer.FileSystem.GetFileInfo("Dosyanın Konumu").Length)
Dim SizeType As String = "B"
If TheSize < 1024 Then
CalculatedSize = TheSize
ElseIf TheSize > 1024 AndAlso TheSize < (1024 ^ 2) Then 'KB
CalculatedSize = Math.Round((TheSize / 1024), 2)
SizeType = "KB"
ElseIf TheSize > (1024 ^ 2) AndAlso TheSize < (1024 ^ 3) Then 'MB
CalculatedSize = Math.Round((TheSize / (1024 ^ 2)), 2)
SizeType = "MB"
ElseIf TheSize > (1024 ^ 3) AndAlso TheSize < (1024 ^ 4) Then 'GB
CalculatedSize = Math.Round((TheSize / (1024 ^ 3)), 2)
SizeType = "GB"
ElseIf TheSize > (1024 ^ 4) Then 'TB
CalculatedSize = Math.Round((TheSize / (1024 ^ 4)), 2)
SizeType = "TB"
End If
MessageBox.Show("Dosya Boyutu " & CalculatedSize.ToString & " " & SizeType, MessageBoxButtons.OK, MessageBoxIcon.Information)
bunlar nasıl kullanılıyor bilmiyorum ama yararlı bir şeye benziyorDosyaları FileDialog ile açarak boyutunu öğrenebilirsiniz , butona atayabilirsiniz yukarıdaki kodları.VB.Net:Dim CalculatedSize As Decimal Dim TheSize As Long = Long.Parse(My.Computer.FileSystem.GetFileInfo("Dosyanın Konumu").Length) Dim SizeType As String = "B" If TheSize < 1024 Then CalculatedSize = TheSize ElseIf TheSize > 1024 AndAlso TheSize < (1024 ^ 2) Then 'KB CalculatedSize = Math.Round((TheSize / 1024), 2) SizeType = "KB" ElseIf TheSize > (1024 ^ 2) AndAlso TheSize < (1024 ^ 3) Then 'MB CalculatedSize = Math.Round((TheSize / (1024 ^ 2)), 2) SizeType = "MB" ElseIf TheSize > (1024 ^ 3) AndAlso TheSize < (1024 ^ 4) Then 'GB CalculatedSize = Math.Round((TheSize / (1024 ^ 3)), 2) SizeType = "GB" ElseIf TheSize > (1024 ^ 4) Then 'TB CalculatedSize = Math.Round((TheSize / (1024 ^ 4)), 2) SizeType = "TB" End If MessageBox.Show("Dosya Boyutu " & CalculatedSize.ToString & " " & SizeType, MessageBoxButtons.OK, MessageBoxIcon.Information)
Son anda küfür yemekten kurtuldun kardeşim tebrikler..dosya sağ tık özellikler diyerek bakamıyor muyduk? ( özür dilerim visual basic programlama konusuymuş genel of topic sandım pardon)
Neyi başaramadın kardeşim olayım yardımcı özelden yaz bana.yani yapamadım yardım edicekmisin aga
Yotuube'ye arat kanka çok kolay yapılış anlatımları var.yani yapamadım yardım edicekmisin aga
eyw aga baktım ve yapabildim sağolasınSağol dostum öğrendim sonunda.
Post automatically merged:
Yotuube'ye arat kanka çok kolay yapılış anlatımları var.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?