ITYourself! - компьютерная документация, книги, мануалы, it-тематика

14. ?????

E-mail Печать PDF
Рейтинг пользователей: / 0
ХудшийЛучший 
Индекс материала
14. ?????
?????? ? ?????????? ? ???????
Все страницы

Files/FileSystem

?????? ??????. ?????? ? ???????

 

? .NET Framework - ?????????? ???????? ????????? ??????, ?? ????????? ?? ?????????. ???? ???????? ??????? ?? ??????? ?????? (stream), ????????? ??? ?????? ????? ???? ???????????? ? ???? ?????? ??????. ????? - ??? ????????, ??????????? ???????? ?????? ? ??????, ???????? ?????, ??????, ?????????? ?? ????, ?????? ? ??????? ??????.

 

????? Stream

??????????? ???????? ?????-?????? ??????????? ? ???????????? ???? SystemIO. ??? ?????????? ???? ???????? ???????????? ??????????? ????? Stream.

???????? ??????, ??????????? ?? Stream

?????

????????

FileStream

?????? ? ??????

MemoryStream

???? ?????? (????? ???????????? ??? ?????? ? ????????)

NetworkStream

??????, ?????????? ? ???? ?????? ?? ???????? ??????????

???????? ???????? ? ?????? ?????? Stream:

????? / ????????

????????

CanRead

??????? ????????? ??????

CanWrite

??????? ????????? ??????

CanSeek

??????? ????????? ??????????? ? ??????

Read

?????? ????????? ?????????? ??????, ??????? ? ??????? ???????. ?????????? ?????????? ??????? ??????????? ??????

ReadByte

?????? ?????????? ?????. ???? ??????? ??????? ????????? ? ????? ??????, ?????????? -1

Write

?????? ????????? ?????????? ?????? ??????? ? ??????? ???????

WriteByte

?????? ?????????? ?????

Length

????? ?????? ? ??????

Position

??????? ? ??????? ??????

Flush

?????? ?????? ? ???????? ???? ???????, ???????????? ???????

Close

??????? ????? ? ?????????? ???????????? ???????

 

????? FileStream

???? - ???????? ??????? ???????? ???????, ??????????????? ??? ???????? ??????????. ??? ???????? ??? ??????/?????? ???? ?????????? ???????.

????? FileStream ???????????? ??? ????????, ??????, ?????? ? ???????? ??????. ??? ???????? ????? ??? ???????? ?????? ????? ??????? ?????? ?????? FileStream

FileStream(ByVal strFileName As String, ByVal fm As FileMode, ByVal fa As FileAccess, ByVal fs As FileShare)

???, strFileName ?????????? ??? ?????;

FileMode ?????????? ???????? ? ??????;

???????????? FileMode

????????

????????

CreateNew

??????? ????. ??????, ???? ???? ??????????.

Create

??????? ????. ???? ???? ??????????, ??? ?????????? ?????????

Open

??????? ????. ??????, ???? ???? ?? ??????????

OpenOrCreate

??????? ????. ???? ????? ?? ??????????, ???????

Append

????????? ????????? ? ????? ?????. ??????? ???? ???? ?? ??????????

FileAccess ????????? ????? ??????? ? ?????;

???????????? FileAccess

????????

????????

Read

??????? ??? ??????

Write

??????? ??? ??????

ReadWrite

??????? ??? ?????? ? ?????? (?? ?????????)

FileShare ????????? ??????? ????? ??????????? ??????? ? ?????.

???????????? FileShare

????????

????????

None

????????? ?????? ?????? ????????? ? ????? (?? ?????????)

Read

????????? ?????? ????????? ?????? ?? ?????

Write

????????? ?????? ????????? ?????? ? ????

ReadWrite

?????? ?????? ? ?????

 

???????? ?????? ? ???????? ?????? FileStream

????? / ????????

????????

 

Handle

???????? ??????????? ???????????? ??????? ??? ?????

 

Position

??????? ??????? ? ?????. ????????? ??????? ?????????? ? ????. ??????? ? ????? ????? ????? ? ??????? ???????? Length

 

Lock

????????? ?????? ? ????? ??? ??? ????? ?? ??????? ?????? ?????????

Seek

????????????? ????????? ??????? ??????? ? ???????? ?????????. ????? ??????? ???????????? ?????????? Begin, ?urrent ??? End

Unlock

??????? ?????????? ? ????? ??????????????? ????? ?????

???????? Length ? ?????? Write, WriteByte, Read, ReadByte, Close ?????????? ??????? ?????? Stream. ???????? CanSeek ?????? ????? True ??? ???????? ??????.

 

????? Environment

????? Environment ????????? ???????? ???????? ?????????? ?????. ?????? GetLogicalDrives ? GetFolderPath ?????????? ?????????? ? ???????? ???????.

???????? CurrentDirectory ????????? ???????? ??? ?????????? ??????? ???? ? ??????? ??? ??????????. ??? ??????????? ???????? ???????? ????? ???????? ????????????? ????, ??????? ?????? .., ??????????? ?? ???????????? ???????.

 

????? Path

????? Path ???????????? ??? ????????? ???? ??????

???????? ?????? ? ???????? ?????? Path

???????? / ?????

????????

DirectorySeparatorChar

??????-??????????? ????? ??? ??????? ?????????

InvalidPathChars

?????? ????????, ???????????? ? ????? ?????

ChangeExtension

???????? ?????????? ????? ? ?????????? ????? ???

GetDirectoryName

?????????? ???? ? ????????, ? ??????? ????????? ????

GetFileName

?????????? ??? ?????

GetExtension

?????????? ?????????? ?????

GetFileNameWithoutExtension

?????????? ??? ????? ??? ??????????

Combine

?????????? ???? ? ????? ?/??? ?????? ?????


?????? ? ?????????? ? ???????

? VB .NET ?????????? ??? ?????? ??? ?????? ? ??????????: Directory ? DirectoryInfo ? ??? ?????? ??? ?????? ? ???????: File ? FileInfo.

?????? Directory ? File ???????? ???????????? ?? Object, ? ?????? DirectoryInfo ? FileInfo ?? ?????? FileSystemInfo ? ???????? ??????? ??????, ??????? ????????? ? ?? ?????? ?????????? ????? ?????????? ??????????.

????? ??????? Directory ? File ?????????? ?????? ? ????????? ????????? ??? ??????, ? ????? ??????? DirectoryInfo ? FileInfo ?????????? ????? ???????.

???????? ?????? ?????? Directory

?????

????????

CreateDirectory

??????? ??????? ? ???????? ?????? ? ?????????? ?????? DirectoryInfo ??? ?????????? ????????. ??? ????????????? ????????? ??? ????????????? ?????

Delete

??????? ?????? ???????. ??? ???????? ?????, ?????????? ????? ??? ????????? ?????, ??????? ???????????? ????? Delete(??? ?????, True)

Exists

?????????? ??????? ????????????? ????????

GetCreationTime

?????????? ???? ? ????? ???????? ????????

GetCurrentDirectory

?????????? ?????? ???? ? ???????? ????????

GetDirectories

?????????? ?????? ????? ? ????????? ????????????.

GetFiles

?????????? ?????? ????? ? ?????????? ?????? ????????.

GetLastAccessTime

?????????? ????? ?????????? ????????? ? ????????

GetLastWriteTime

?????????? ????? ????????? ?????? ? ???????

GetLogicalDrives

?????????? ????????? ?????? ? ??????? ?????????? ?????? ? ??????? ????:\ (????????, ?:\)

Move

?????????? ???????

SetCurrentDirectory

?????? ??????? ???????

 

???????? ?????? ?????? File

?????

????????

Copy

??????????? ?????

GetAttributes

?????????? ????????????? ???????? ????? (????????, ??????? ? ?.?.)

SetAttributes

?????? ???????? ?????

?????? Exists, Delete, GetCreationTime, GetLastAccessTime, GetLastWriteTime, Move ?????????? ??????? ?????? Directory

 

????? FileSystemInfo ???????? ??????? ??? ??????? DirectoryInfo ? FileInfo ? ???????? ??????? ????? ?? ????? ????????????????.

???????? ?????? ? ???????? ?????? FileSystemInfo

????? / ????????

????????

Attributes

???????? ???????

CreationTime

????? ???????? ???????

Extension

?????????? ?????

FullName

?????? ??? ???????? ??? ?????

Refresh

????????? ????????? ???????

??? ???????, ??? ???????? ??????????? ??????? DirectoryInfo ? FileInfo ??????????? ??? ???????? ??? ?????. ??????:

Dim myDirectory As DirectoryInfo

myDirectory = New DirectoryInfo("C:\TestDirectory")

Dim currentDir As New DirectoryInfo(".")

???????? ?????? ? ???????? ?????? DirectoryInfo

????? / ????????

????????

Exists

?????????? ??????? ????????????? ????????

Name

??? ????????

Parent

?????? DirectoryInfo ??? ????????????? ???????? (??? ???????? ????????? ???????????? Nothing)

Create

??????? ???????

Delete

??????? ?????? ???????

GetDirectories

?????????? ?????? ???????? DirectoryInfo ??? ????????????

GetFiles

?????????? ?????? ???????? FileInfo ??? ?????? ???????? ????????

???????? ?????? ? ???????? ?????? FileInfo

????? / ????????

????????

Directory

?????? DirectoryInfo ??? ????????, ? ??????? ????????? ????

DirectoryName

?????? ???? ? ????? ? ????????? ????

CopyTo

???????? ???? ? ?????????? ?????? FileInfo ??? ?????

Create

??????? ???? ?? ?????

MoveTo

?????????? ????

???? ??????

????? ?????? ???? ?????:

1.????????? ????? (????? ????????????????? ???????). ??????? ?? ????? ?????? ?????, ?????????? ???? ?? ????? ????? ???????????? ????????? - ??????? ??????? ? ??????? ??????.

2.?????????????? (????????) ????? (????? ????????????? (???????) ???????). ??????? ?? ?????? ??????? ?????????? ?????.

3.???????????????? ?????. ???????????? ? ???? ?????? ??????, ?? ???????????? ?? ? ????? ?????????? ?????????.

 

Files/TextFiles

?????? ? ?????????? ???????

? ?????? ???????, ???? ?????????? ???????, ?? ???? ??????? ? ?????-?? ????? ?????? - ???????? ??????? ??? ?????? ????????? FileOpen:

FileOpen(filenumber, filename, workmode)

???, filename - ??? ??? ????? ?? ?????,

filenumber - ????? ????????????? ???????? ?????,

workmode - ????? ?????? (OpenMode.Input (??? ??????), OpenMode.Output (??? ??????), OpenMode.Append (??? ??????????)).

?????? ?? ?????:

??????? LineInput(filenumber) ????????? ????????? ?????? ?? ???????? ?????.

????????? Input(filenumer,variable) ????????? ????????, ??????????? ????????.

?????? ? ????:

????????? Print(filenumber, var) ? PrintLine(filenumber, var) ???????? ?????? ?????? ?? ?????????? var ? ???? ? ??????? filenumber. PrintLine ?????????? ?? Print ???, ??? ????????? ????? ???????? var ??????? ??????? ? ??????? ??????.

??? ???????? ????? ???????????? ????????? FileClose(filenumber).

??????? EOF(filenumber) ?????????? True, ???? ????????? ????? ?????.

? ???????????? ???? SystemIO ?????????? ??????????? ?????? ??? ?????? ? ?????? ????????? ??????: StreamReader ? StreamWriter.

 

Files/BinaryFiles

?????? ? ??????????????? ???????

?????????????? ????? ??? ????? ??????? ??????? ??????? ?? ?????? ?????????? ???????, ??? ???????? ????? ? ??????????? ?? ?????. ????? ?????????, ????????, ???????? ????? ??????. ???????? ? ????? ????? ??????????? ????? ?????????? ? ??????????? ??????????? ??? ???, ???? ????????, ????????.

????? ??????? ?????????????? ???? ?????????? ? ????????? FileOpen ??????? ????? ?????? OpenMode.Random (?????? ? ??????) ? ?????? ???????? ????????? RecordLength (?????? ?????? ? ??????):

FiIeOpen(filenumber, filename, workmode , , RecordLength)

?????? ?? ?????: ????????? FiIeGetObject(filenumber,var,recnumber)

?????? ? ????: ????????? FilePutObject(filenumber,var,recnumber)

??? recnumber - ????? ??????. ????????? ?????????? ? 1, ?? ????????? ???????? ???????????? ? ??????? ???????.

??????? Space(K) ?????????? ??????, ????????? ?? ? ????????. ????? ????????? ?????? S ?? ????? N, ???????????? ????????? S +Space(N-Len(S))

??????? LOF ?????????? ????? ????? ? ??????. ???????? ?????????? ???????? ?? ?????? ?????? ????? ???????? ?????????? ???????.

??? ?????? ? ?????? ???????? ?????? ?????????? ??????????? ?????? BinaryReader ? BinaryWriter.

 

Files/RandomFiles

?????? ? ????????????????? ???????

?????? ? ????????????????? ??????? ????? ?????? ?? ?????? ? ??????? ??????? ???????. ? ???????? ?????? ?????? ??? ???????? ????? ??????????? OpenMode.Binary, ? ?????? ? ?????? ???????????? ??? ?????? ???????? FileGetObject ? FilePutObject. ??? ???? ???????? ????????? recnumber ???????? ?? ????? ??????, ? ???????? ? ?????? ?? ?????? ?????. ????? ?????? ?????? ????? ???????? 1. ????? ???????? ?????-???? ??????, ?????????? ???????? ??? ??????, ?????????????? ?????????.

??? ????? ????? ????????????? ??? ????????????????. ??????? ???????????? ?????? ??? ?????? ? ??? ??????, ???? ????? ??????? ?? ????? ???????? ????????, ? ?????? ????? ?? ????? ???????????.

 

 

Добавьтe Ваш комментарий

Ваше имя (псевдоним):
Ваш адрес почты:
Заголовок:
Комментарий:

???????????

??????????




??????? ?????????

????????

Внимание!!! Файл sape.php не обнаружен. Проверьте правильность установки кода Sape.


C???????? ?????????