Make a restriction for your program menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    Ebonesser's Avatar Member
    Reputation
    33
    Join Date
    Mar 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Make a restriction for your program

    If you want to make a program that's only for one person, then you can use this code in a MODULE:

    VB6:

    Option Explicit

    Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
    (ByVal lpBuffer As String, nSize As Long) As Long

    Sub Get_User_Name()

    Dim lpBuff As String * 25
    Dim ret As Long, UserName As String

    ret = GetUserName(lpBuff, 25)
    UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)

    If UserName = "Ebonesser" Then
    Form2.Show
    Else
    MsgBox "This program does not belong to you ", vbOKOnly + vbCritical, "ERROR!"
    End If
    End Sub
    VB 2005+:
    Option Explicit On
    Module Module1
    Sub Get_User_Name()

    Dim fName As String = Environment.UserName
    If fName = "Ebonesser" Then
    Form2.Show()
    Else
    MsgBox("This program does not belong to you ", vbOKOnly + vbCritical, "ERROR!")
    End If
    End Sub
    End Module
    Call on these modules with something like this:

    VB6:
    Private Sub Command1_Click()
    Module1.Get_User_Name
    End Sub
    VB 2005+:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Module1.Get_User_Name()
    End Sub
    I used "Ebonesser" as user example.
    If you want to make it for more people, just do ""Ebonesser" or "Daniel" or "Martin"" and so many people you want, just use "or" in between. This is very useful for school/work networks where you can't change usernames, but also for homes because the person that is using your program doesn't know that you're using his/her username as a "key" to open the program. If the user changes the username and tells you that the program doesn't work, do a new program with his/her new name.
    But these codes are mostly for school/work networks, where you can't change your name
    I hope you like it and use it


    //Ebonesser
    Last edited by Ebonesser; 06-19-2009 at 05:39 PM.

    Make a restriction for your program

Similar Threads

  1. Howto make a catapult for your server.
    By edet123 in forum WoW EMU Guides & Tutorials
    Replies: 14
    Last Post: 07-12-2008, 01:05 PM
  2. How to make custom items for your server! WITH PICS! [Noob friendly]
    By ',-Jurkey-,' in forum WoW EMU Guides & Tutorials
    Replies: 7
    Last Post: 03-29-2008, 09:54 AM
  3. [Guide] How-To make custom items for your server[Noob Friendly]
    By FelBlood in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 03-29-2008, 06:50 AM
  4. The easy way to make custom items for your server WITH PICTURES! [Noob friendly]
    By ',-Jurkey-,' in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 03-19-2008, 09:44 AM
  5. Herleybob - Making a site for your Public Server!
    By Herleybob in forum WoW EMU Guides & Tutorials
    Replies: 64
    Last Post: 12-30-2007, 08:41 PM
All times are GMT -5. The time now is 12:54 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search