dcsimg
Results 1 to 3 of 3

Thread: any way for create afile and check it for lock without can duplicate?

  1. #1

    Thread Starter
    Addicted Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Posts
    201

    any way for create afile and check it for lock without can duplicate?

    hi,i want create a vb exe program like as 1.exe to always check 1.txt in same path and 1.txt is any data.
    but important for me to nobody can create like as 1.txt with any way.
    if any body deleted 1.txt or created or replace another 1.txt with my 1.txt or with same data so my program can check is same orginal file or not.
    i checked md5 algorythms or crc or date modified or created or like these ways but i can not find way yet for this.

    how can do that?

  2. #2
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine
    Posts
    555

    Re: any way for create afile and check it for lock without can duplicate?

    Hi,

    can you describe the end goal more clearly?
    What is that file for? Why do you need to lock?

    any way for create afile and check it for lock without can duplicate?
    Check is another program lock the file? Or make own lock?

    The simpliest way:
    Code:
    Open "c:\temp\1.txt" For Binary Access Read Write Lock Write As #1
    https://docs.microsoft.com/en-us/off...open-statement

  3. #3
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,834

    Re: any way for create afile and check it for lock without can duplicate?

    Quote Originally Posted by Black_Storm View Post
    hi,i want create a vb exe program like as 1.exe to always check 1.txt in same path and 1.txt is any data.
    but important for me to nobody can create like as 1.txt with any way.
    if any body deleted 1.txt or created or replace another 1.txt with my 1.txt or with same data so my program can check is same orginal file or not.
    i checked md5 algorythms or crc or date modified or created or like these ways but i can not find way yet for this.

    how can do that?
    If you're using the RC5 within your App, you can calculate a current CheckSum of your companion-file at App-Startup like that:
    Code:
    CheckSumHex = New_c.FSO.GetFileHash(App.Path & "\1.txt", CALG_SHA1)
    That would require you, to compile each instance of your Exe specifically though:
    - after determining the checksum of your companion-file "as originally delivered"
    - to be able to compare that internal checksum-literal later, against the current checksum of that file

    In case this is thought as a kind of "simple licensing-scheme", you will have to be aware,
    that "skipping that final If-Then-comparison" - is an easy task - even for non-experienced crackers...

    Olaf

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width