Hi Guys, Begging For help. How to Make a program run on only one or two computer?

Well, it definitely helps to start with one of the more well known languages for a few reasons:
1. easier to search for documentation
2. more help online (forums, sites like github, runnable.com, etc)
3. Major languages are based off other major languages (C -> C++ -> Java -> C#, and so on)
4. More widely used, so they look better on a resume

C# is more of a mix of C++ and Java than just Java.. so it would be more like.. an arrow going from C++ and Java to C# :tongue:

I bold number three because it makes it TONS easier to learn new languages -- The only things you'd have to learn are syntactical differences between the languages, really.
 
Umm any other ways ? like better coding.
I just can't find out how Companies write CopyRight COdes like PC games that u can only install them once!!!!!
it would be great if i get the exact right idea.
Like for example lets put it in this way. there needs to be something in the Program ( THE PRGRAM I MADE using Delphi) that i can identify the registery of the windows, or the computer's Bios number or mac aderess so when my program Verifies the right ID, it works and when it doesn't find anything or when it doesn't find the right Registery/mac adress, it stopps the prgram or it shutsdown the computer !
I just need the coding since i can't really write codes and stuff like that. Need a master :).. Thanks.
 
You wrote the program but don't know what language it's in?
Could we see the source code?

The best way would be to hardcode the MAC addresses into the program and compare the hard-coded address with one returned from the following function:
Code:
private string GetMacAddress()
{
    const int MIN_MAC_ADDR_LENGTH = 12;
    string macAddress = string.Empty;
    long maxSpeed = -1;

    foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
    {
        log.Debug(
            "Found MAC Address: " + nic.GetPhysicalAddress() +
            " Type: " + nic.NetworkInterfaceType);

        string tempMac = nic.GetPhysicalAddress().ToString();
        if (nic.Speed > maxSpeed &&
            !string.IsNullOrEmpty(tempMac) &&
            tempMac.Length >= MIN_MAC_ADDR_LENGTH)
        {
            log.Debug("New Max Speed = " + nic.Speed + ", MAC: " + tempMac);
            maxSpeed = nic.Speed;
            macAddress = tempMac;
        }
    }

    return macAddress;
}
(taken from here: Reliable method to get machine's MAC address in C# - Stack Overflow)

Then verify the returned Mac Address with one that's hard coded. And if they don't match, exit the program.

EDIT:
This will essentially whitelist computers to use your program. Every time you need to run the program on another computer, you'll have to recompile the program (unless you write the white-listed Mac Addresses to a file and read the file to match addresses)

EDIT 2: This is in C#. I Just took a Googled MAC address verification function in C# since I don't know what language you're using :tongue:

There's some problems with this though; if you're trying to get a specific adapter (i.e. ethernet adapter) there's some more conditions you have to put in. I've done it before and made a simple class to do it. I'll post it up once I find it in my projects :).

^ I haven't graduated yet. CarnageX up there is our resident C# expert -- I'm more of a C++ person :tongue: C++ and Linux / UNIX.

And I wouldn't suggest Visual Basic. Do something like Visual C# or Visual C++. Or just about any newer language (C++, Java, C# are just a few that come to mind). VB is outdated.

I'm fine with the PMs. However, if you need any more help, I'd suggest making another thread dealing with specific issues -- you're much more likely to get higher quality responses than I am able to provide myself.

I'm not quite a "professional" programmer -- for now it's hobbyist. I'm still a student :tongue: Been doing various languages for a few years, started with Java and HTML / CSS way back in high school.

Again, if you need any more help feel free to make another thread dealing with specific issues. You'll definitely find people willing to help out ;)

C# is awesome :D haha.

I just graduated last month; just got a job as a software developer for the State Gov. of South Dakota. Currently doing training exercises in C# and VB (older systems are written in VB, so I have to be able to work on those as well... but newer systems will be done in C#).

im not a programmer so ye it takes along tome to get used to C# or C++ :p)

Once you learn one, the others get easier like iFargle said. But yes, I definitely recommend doing it in a higher level / newer language like C#. If you're going to be doing this for Windows machines.. definitely do it in C# because there's tons of libraries for it out there that can do a lot for you.
 
Well, it definitely helps to start with one of the more well known languages for a few reasons:
1. easier to search for documentation
2. more help online (forums, sites like github, runnable.com, etc)
3. Major languages are based off other major languages (C -> C++ -> Java -> C#, and so on)
4. More widely used, so they look better on a resume

C# is more of a mix of C++ and Java than just Java.. so it would be more like.. an arrow going from C++ and Java to C# :tongue:

I bold number three because it makes it TONS easier to learn new languages -- The only things you'd have to learn are syntactical differences between the languages, really.
i Just have to play with it thats how i learn :)
 
As professionals are saying i have to get started with C# thank you i only knew VB, Delphi and C++ not even C# :3
so anyways guys thank you for the time you guys are spending and if you found any solutions plz let me know it would be awesome!
 
Ok, here's a demo console application containing the class (LicenseCheck.cs) that I made. See attached file.

Let me know if that's like what you wanted. You'd just have to modify the class to be able to loop through either a list or array of strings, or modify the CheckLicense method and have it accept an argument or something. You could then get the current license, check if it's in an array or list of strings hardcoded in the class, and go from there.
 

Attachments

  • LicenseCheck.zip
    40.2 KB · Views: 2
Oh boy ty That's exactly what i wanted now gotta try it out ! thanks alot man! u guys rock.Cya!
Thanks again guys wish the best lockz for ya!
 
Back
Top Bottom