WWW.ИСХОДНИКИ.РУ cpp.sources.ru
java.sources.ru web.sources.ru soft.sources.ru
jdbc.sources.ru asp.sources.ru api.sources.ru

  Форум на исходниках
  Visual Basic
  Как отформатировать винт?

СПРОСИТЬ  ОТВЕТИТЬ
профайл | регистрация | faq

Автор Тема:   Как отформатировать винт?
AlexR опубликован 19-11-2001 19:42 MSK   Click Here to See the Profile for AlexR   Click Here to Email AlexR  
Как отформатировать винт?
k2mcb опубликован 20-11-2001 01:56 MSK     Click Here to See the Profile for k2mcb  Click Here to Email k2mcb     
Загрузись с загрузочной дискеты в DOS
У тебя появится
А:\
набираешь команду
А:\format c:
И все дела.
А если ты хочешь рабить винт на диски, то это дело посложнее.
cr опубликован 20-11-2001 12:53 MSK     Click Here to See the Profile for cr  Click Here to Email cr     
Хех:)
Интересно, для чего это?

Есть примерчик, как отформатировать флоппи, попробуй переделать под винт.

' This code was donated by Duncan Diep (Duncan.Diep@myna.com)
' Объявления

Private Declare Function SHFormatDrive Lib "shell32" _
(ByVal hwnd As Long, ByVal Drive As Long, ByVal fmtID As Long, _
ByVal options As Long) As Long
Private Declare Function GetDriveType Lib "kernel32" Alias _
"GetDriveTypeA" (ByVal nDrive As String) As Long

' Добавляем 2 кнопки:
' cmdFormat и cmdDiskCopy

Private Sub cmdFormatDrive_Click()
Dim DriveLetter$, DriveNumber&, DriveType& Dim RetVal&, RetFromMsg%
DriveLetter = UCase(Drive1.Drive)
DriveNumber = (Asc(DriveLetter) - 65) ' Change letter to Number: A=0
DriveType = GetDriveType(DriveLetter)
If DriveType = 2 Then 'Floppies, etc
RetVal = SHFormatDrive(Me.hwnd, DriveNumber, 0&, 0&)
Else
RetFromMsg = MsgBox("This drive is NOT a removeable" & vbCrLf & _
"drive! Format this drive?", 276, "SHFormatDrive Example")
Select Case RetFromMsg
Case 6 'Yes
' Без комментариев ...
'RetVal = SHFormatDrive(Me.hwnd, DriveNumber, 0&, 0&)
Case 7 'No
' Do nothing
End Select
End If
End Sub

Private Sub cmdDiskCopy_Click()
' DiskCopyRunDll takes two parameters- From and To
Dim DriveLetter$, DriveNumber&, DriveType&
Dim RetVal&, RetFromMsg&
DriveLetter = UCase(Drive1.Drive)
DriveNumber = (Asc(DriveLetter) - 65)
DriveType = GetDriveType(DriveLetter)
If DriveType = 2 Then 'Floppies, etc
RetVal = Shell("rundll32.exe diskcopy.dll,DiskCopyRunDll " _
& DriveNumber & "," & DriveNumber, 1) 'Notice space after
Else ' Just in case 'DiskCopyRunDll
RetFromMsg = MsgBox("Only floppies can" & vbCrLf & _
"be diskcopied!", 64, "DiskCopy Example")
End If
End Sub

' Добавляем один ListDrive с именем Drive1

Private Sub Drive1_Change()
Dim DriveLetter$, DriveNumber&, DriveType&
DriveLetter = UCase(Drive1.Drive)
DriveNumber = (Asc(DriveLetter) - 65)
DriveType = GetDriveType(DriveLetter)
If DriveType <> 2 Then 'Floppies, etc
cmdDiskCopy.Enabled = False
Else
cmdDiskCopy.Enabled = True
End If
End Sub

AlexR опубликован 20-11-2001 19:04 MSK     Click Here to See the Profile for AlexR  Click Here to Email AlexR     
Уже отформатировал...

СПРОСИТЬ  ОТВЕТИТЬ
Перейти:


E-mail | WWW.ИСХОДНИКИ.RU

Powered by: Ultimate Bulletin Board, Freeware Version 5.10a
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.