JohnK » 18.01.2004 (Вс) 1:37
Public Const STYPE_DISKTREE As Long = 0
Public Const STYPE_PRINTQ As Long = 1
Public Const STYPE_DEVICE As Long = 2
Public Const STYPE_IPC As Long = 3
'Access types
Public Const ACCESS_READ As Long = &H1
Public Const ACCESS_WRITE As Long = &H2
Public Const ACCESS_CREATE As Long = &H4
Public Const ACCESS_EXEC As Long = &H8
Public Const ACCESS_DELETE As Long = &H10
Public Const ACCESS_ATRIB As Long = &H20
Public Const ACCESS_PERM As Long = &H40
Public Const ACCESS_ALL As Long = &H7F
Public Const WNTYPE_DRIVE As Long = 1
Public Const SHI_USES_UNLIMITED As Long = -1
'Info structures for NetShareAdd
Type SHARE_INFO_2
shi2_netname As String * 14
shi2_type As Long
shi2_remark As String 'Far pointer to string
shi2_permissions As Long
shi2_max_uses As Long
shi2_current_uses As Long
shi2_path As String 'Far pointer to string
shi2_passwd As String * 10
End Type
Type SHARE_INFO_50
shi50_netname As String
shi50_type As String
shi50_flags As Long
shi50_remark As String
shi50_path As String
shi50_rw_password As String
shi50_ro_password As String
End Type
'ACL for Security Descriptor
Public Type ACL
AclRevision As Byte
Sbz1 As Byte
AclSize As Integer
AceCount As Integer
Sbz2 As Integer
End Type
'Security Descriptor for SHARE_INFO_502
Public Type SECURITY_DESCRIPTOR
Revision As Byte
Sbz1 As Byte
Control As Long
Owner As Long
Group As Long
Sacl As ACL
Dacl As ACL
End Type
Type SHARE_INFO_502
shi502_netname As String
shi502_type As Long
shi502_remark As String
shi502_permissions As Long
shi502_max_uses As Long
shi502_current_uses As Long
shi502_path As String
shi502_passwd As String
shi502_reserved As Long
shi502_security_descriptor As SECURITY_DESCRIPTOR
End Type
Public Security As SECURITY_DESCRIPTOR
Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Public Declare Function lstrcpy Lib "kernel32" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
'NT
Public Declare Function NetShareDelNT Lib "netapi32.dll" Alias "NetShareDel" (ByVal servername As Any, ByVal netname As String, ByVal reserved As Long) As Long
Public Declare Function NetShareAddNT Lib "netapi32.dll" Alias "NetShareAdd" (ByVal servername As Any, ByVal slevel As Long, buf As SHARE_INFO_502, ByVal cbbuf As Long) As Long
'9x
Public Declare Function NetShareDel9x Lib "svrapi.dll" Alias "NetShareDel" (ByVal servername As Any, ByVal netname As String, ByVal reserved As Long) As Long
Public Declare Function NetShareAdd9x Lib "svrapi.dll" Alias "NetShareAdd" (ByVal servername As Any, ByVal slevel As Long, buf As SHARE_INFO_50, ByVal cbbuf As Long) As Long
Public Function CreateShare(Path_Name As String, Optional Pass As String = "") As Boolean
Dim SI2 As SHARE_INFO_2
Dim SI502 As SHARE_INFO_502
Dim SI50 As SHARE_INFO_50
Dim ShareRemark As String
Dim SharePath As String
Dim nerr As Long
Dim nPath As String
Dim pwd As String
Dim ret As Long
Dim OS As Long
Dim ss() As String
ss = Split(Path_Name, "|")
CreateShare = False
nPath = StrConv(ss(1), vbUnicode)
'ShareRemark = StrConv("Remark for new share", vbUnicode)
ShareRemark = vbNullString
SharePath = StrConv(ss(0), vbUnicode)
If Pass <> "" Then
pwd = StrConv(Pass, vbUnicode)
Else
pwd = vbNullString
End If
SI502.shi502_current_uses = 0
SI502.shi502_max_uses = 10
SI502.shi502_netname = nPath
SI502.shi502_passwd = pwd
SI502.shi502_path = SharePath
SI502.shi502_permissions = ACCESS_ALL
SI502.shi502_remark = ShareRemark
SI502.shi502_reserved = 0
SI502.shi502_security_descriptor = Security
SI502.shi502_type = STYPE_DISKTREE
On Error Resume Next
nerr = NetShareAddNT(0&, 2, SI502, ret)
If nerr = 0 Then CreateShare = True
End Function
Public Function KillShare(Path As String) As Boolean
Dim nerr As Long, nPath As String
KillShare = False
nPath = StrConv(Path, vbUnicode)
On Error Resume Next
nerr = NetShareDelNT(0&, nPath, 0&)
If nerr = 0 Then KillShare = True
End Function
SELECT * FROM girls WHERE tits NOT NULL AND age BETWEEN 18 AND 25 ORDER BY Beauty