منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : دالة لفتح ملف نصي
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : جهاد العريقي


كود :
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
ولاتنسونا من خالص الدعاء