منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
دالة لفتح ملف نصي - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (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)
+---- الموضوع : دالة لفتح ملف نصي (/showthread.php?tid=6361)



دالة لفتح ملف نصي - RaggiTech - 17-10-12

كاتب الموضوع : جهاد العريقي


كود :
Public Function ReadTextFromFile(ByVal Filename As String) As String
' Returns text from the specified file

On Error Resume Next
Dim strFileText As String
' Open the file and launch StreamReader object

Dim MyReader As System.IO.StreamReader = System.IO.File.OpenText(Filename)

' Read all text through to the end
strFileText = MyReader.ReadToEnd

' Close the stream
MyReader.Close()

' Return data
Return strFileText
End Function
ولاتنسونا من خالص الدعاء