تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تطبيق كامل منقول - التعامل مع الملفات في ASP.net
#1
كاتب الموضوع : AhmedEssawy

التطبيق منقول وشرح الخطوات والمهام موجود ضمن الكود .

كود :
'**************************************
' Name: Basic File Functions - Its Easy
' Description:File Manipulation Functions. No API
' By: Pankaj Nagar
'
'
' Inputs:None
'
' Returns:Depends
'
'Assumes:None
'
'Side Effects:None
'**************************************
' Basic File Functions
' ---------------------
' ---------
' Read File
' ---------
Imports System
Imports System.IO
Public Module modmain
Sub Main()
Dim srFile as StreamReader = File.OpenText("C:\autoexec.bat")
Console.WriteLine(srFile.ReadToEnd())
srFile.Close
End Sub
End Module

' ----------
' Write File
' ----------
Imports System
Imports System.IO
Public Module modmain
Sub Main()
Dim swFile as StreamWriter = File.CreateText("C:\test.txt")
swFile.WriteLine("Hello World ;)")
swFile.Flush()
swFile.Close()
End Sub
End Module
' -----------------
' File Version Info
' -----------------
Imports System
Imports System.Diagnostics
Public Module modmain
Sub Main()
Dim versionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo("C:\WINNT\Notepad.exe")
Console.WriteLine("Notepad version " + versionInfo.FileVersion)
Console.WriteLine("Description: " + versionInfo.FileDescription)
End Sub
End Module

' ---------
' File Size
' ---------
Imports System
Imports System.IO
Public Module modmain
Sub Main()
Dim MyFile as new FileInfo ("c:\autoexec.bat")
Console.WriteLine("The length of autoexec.bat is " _
+ MyFile.Length.ToString + " bytes.")
End Sub
End Module

' -------------------------
' Copy Move and Delete File
' -------------------------
Imports System
Imports System.IO
Public Module modmain
Sub Main()
File.Copy("c:\autoexec.bat", "c:\autocopy.ext")
File.Move("c:\autocopy.ext", "c:\newname.ext")
File.Delete("c:\autocopy.ext")
End Sub
End Module
' -------------------
' Temporary File Name
' -------------------
' The GetTempFileName function creates a name for a temporary file. The filename is the concatenation of specified path and prefix strings, a hexadecimal string formed from a specified integer, and the .TMP extension.
Imports System
Imports System.IO
Public Module modmain
Sub Main()
Console.WriteLine(Path.GetTempFileName)
End Sub
End Module
}}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  التعامل مع ال Cookies RaggiTech 0 1,971 17-10-12, 10:52 PM
آخر رد: RaggiTech
  لعرض الملفات داخل مجلد معين Asp RaggiTech 0 1,983 17-10-12, 10:48 PM
آخر رد: RaggiTech
  تطبيق منقول - عمل Uplodad من خلال ASP RaggiTech 1 2,193 17-10-12, 10:43 PM
آخر رد: RaggiTech
  تطبيق صغير ، عمل البوم صور من خلال Asp RaggiTech 0 1,755 17-10-12, 10:41 PM
آخر رد: RaggiTech
  تطبيق انشاء pdf file من خلال ASP.net RaggiTech 0 1,575 17-10-12, 10:40 PM
آخر رد: RaggiTech
  تطبيق Style على Control معين RaggiTech 0 1,389 17-10-12, 10:39 PM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم