17-10-12, 05:30 PM
كاتب الموضوع : AhmedEssawy
لعرض معلومات النظام(File System) عن المجلد
C#:
كود :
[align=left][FONT=Courier New][color=blue]private[/color] [color=blue]void[/color] DisplayFSIProperties([color=teal]DirectoryInfo [/color]fsi)[/FONT]
[FONT=Courier New]{[/FONT]
[FONT=Courier New]lblAttributes.Text = fsi.Attributes.ToString();[/FONT]
[FONT=Courier New]lblCreationTime.Text = fsi.CreationTime.ToString();[/FONT]
[FONT=Courier New]lblLastAccessTime.Text = fsi.LastAccessTime.ToString();[/FONT]
[FONT=Courier New]lblLastWriteTime.Text = fsi.LastWriteTime.ToString();[/FONT]
[FONT=Courier New]lblExtension.Text = fsi.Extension;[/FONT]
[FONT=Courier New]lblFullName.Text = fsi.FullName;[/FONT]
[FONT=Courier New]lblName.Text = fsi.Name;[/FONT]
[FONT=Courier New][color=green]// Display properties common to both DirectoryInfo[/color][/FONT]
[FONT=Courier New][color=green]// and FileInfo objects. Note that this works [/color][/FONT]
[FONT=Courier New][color=green]// because both objects inherit from FileSystemInfo.[/color][/FONT]
[FONT=Courier New]}[/FONT][/align]
كود :
[FONT=Courier New][SIZE=2][color=#0000ff]Private[/color][/SIZE][SIZE=2][color=#0000ff]Sub[/color][/SIZE][SIZE=2] DisplayFSIProperties([/SIZE][SIZE=2][color=#0000ff]ByVal[/color][/SIZE][SIZE=2] fsi [/SIZE][SIZE=2][color=#0000ff]As[/color][/SIZE][SIZE=2] IO.DirectoryInfo)
lblAttributes.Text = fsi.Attributes.ToString()
lblCreationTime.Text = fsi.CreationTime.ToString()
lblLastAccessTime.Text = fsi.LastAccessTime.ToString()
lblLastWriteTime.Text = fsi.LastWriteTime.ToString()
lblExtension.Text = fsi.Extension
lblFullName.Text = fsi.FullName
lblName.Text = fsi.Name
[/SIZE][SIZE=2][COLOR=#008000]' Display properties common to both DirectoryInfo
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' and FileInfo objects. Note that this works
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' because both objects inherit from FileSystemInfo.
[/COLOR][/SIZE][SIZE=2][color=#0000ff]End[/color][/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][/FONT][align=left]
[/align]