VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Prevent your application from unauthorised person

by Milind Patil (2 Submissions)
Category: Coding Standards
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (12 Votes)

Prevent your files from copying by unauthorised person.

By default any file's Attribute is Archive.
You have to just remove this Attribute from it's property.
When any one copy this file,at this time the file is again
became Archive we can use this to identifying Unauthorised user.

Rate Prevent your application from unauthorised person

' * ************************************************************
' * Programmer Name : Milind M. Patil
' * E-Mail      :       [email protected] 
' * Date       :       08/29/2001
' **********************************************************************
' * Comments     : Prevent your files from copying by unauthorised person.
' *               
' *               By default any file's Attribute is Archive.
' *               You have to just remove this Attribute from it's property.
' *               When any one copy this file,at this time the file is again      
' *               became Archive we can use this to identifying Unauthorised user.
' *
' **********************************************************************
' Frist Remove The Archive Attribute Of The File And Follow The Simple Code.
Private Sub command1_Click()
Dim result
result = GetAttr("c:\myprojects\project1.exe") And vbArchive
If result = 0 Then
MsgBox "ok"
Else
MsgBox "sorry unautohrised user"
unload me
End If
End Sub
OR
'''''''You can also use API to check files attributes''''''
''''place the code in module1
Declare Function GetFileAttributes Lib "kernel32.dll" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long 
''''place the code on form's command1
Private Sub command1_Click()
dim val as long
val = GetFileAttributes("c:\myprojects\project1.vbp") ' read file attributes
If (attribs And FILE_ATTRIBUTES_ARCHIVE) <> 0 Then msgbox "Sorry Unauthorised Person" ........
.
.
.
End Sub

Download this snippet    Add to My Saved Code

Prevent your application from unauthorised person Comments

No comments have been posted about Prevent your application from unauthorised person. Why not be the first to post a comment about Prevent your application from unauthorised person.

Post your comment

Subject:
Message:
0/1000 characters