منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
للاستعلام عن LogicalDrives الموجوده علي النظام بالC# و VB.net - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد .net (http://vb4arb.com/vb/forumdisplay.php?fid=117)
+---- الموضوع : للاستعلام عن LogicalDrives الموجوده علي النظام بالC# و VB.net (/showthread.php?tid=6191)



للاستعلام عن LogicalDrives الموجوده علي النظام بالC# و VB.net - RaggiTech - 17-10-12

كاتب الموضوع : AhmedEssawy

للاستعلام عن LogicalDrives الموجوده علي النظام .




vb



كود :
[COLOR=teal]
[align=left][FONT=Courier New][color=green]' Sample for the Environment.GetLogicalDrives method[/color][/FONT]
[FONT=Courier New][color=blue]Imports[/color] System [/FONT]
[FONT=Courier New][color=blue]Class[/color] Sample [color=blue]Public[/color] [color=blue]Shared[/color] [color=blue]Sub[/color] Main() [/FONT]
[FONT=Courier New]Console.WriteLine() [color=blue]Dim[/color] drives [color=blue]As[/color] [String]() = Environment.GetLogicalDrives() [/FONT]
[FONT=Courier New]Console.WriteLine([color=maroon]"GetLogicalDrives: {0}"[/color], [String].Join([color=maroon]", "[/color], drives)) [/FONT]
[FONT=Courier New][color=blue]End[/color] [color=blue]Sub[/color] [/FONT]
[FONT=Courier New][color=green]'Main[/color][/FONT]
[FONT=Courier New][color=blue]End[/color] [color=blue]Class[/color] [/FONT]
[FONT=Courier New][color=green]'Sample[/color] [color=green]'[/color] [color=green]'This example produces the following results:[/color] [color=green]'[/color] [color=green]'GetLogicalDrives: A:\, C:\, D:\[/color] [color=green]'[/color] [/FONT][/align]


[/COLOR]
C#




كود :
[COLOR=teal]

[FONT=Courier New][align=left][color=green]// Sample for the Environment.GetLogicalDrives method[/color] [color=blue]using[/color] System; [color=blue]class[/color] Sample { [color=blue]public[/color] [color=blue]static[/color] [color=blue]void[/color] Main() { [/align]
[/FONT]

[FONT=Courier New][align=left]Console.WriteLine(); String[] drives = Environment.GetLogicalDrives(); Console.WriteLine([color=maroon]"GetLogicalDrives: {0}"[/color], String.Join([color=maroon]", "[/color], drives)); } }[/align]
[/FONT]

[FONT=Courier New][align=left]/* This example produces the following results: GetLogicalDrives: A:\, C:\, D:\ */[/align]
[/FONT][align=left]


[/align]
[/COLOR]