[Closed] LockWorkStation in maxscript?
Hi everyone,
I need a function to lock computer via maxscript for a project,just a little protection for this.I searched these codes can do but it’s written by c#,does anyone know how to do it in maxscript?
[DllImport("user32.dll", SetLastError = true)]
static extern bool LockWorkStation();
void LockWorkStationSafe()
{
bool result = LockWorkStation();
if( result == false )
{
// An error occured
throw new Win32Exception( Marshal.GetLastWin32Error() );
}
}
You’ll need to just wrap that c# code in a dynamically compiled assembly. The topic has been explained to death on these forums.
Btw, I assure you that if a script or programs locks my workstation against my will, I will never run anything from that author, and I’m pretty sure I’m not alone in this opinion.
Thanks lo,I don’t know how to wrap c# code to maxscript. :shrug:
this is an option to against hacker,just lock computer when somebody is hacking that what I don’t want to permission,just an idea…(My script was hacked before,even is a free little tool which encrypted to mse format)
The script will not run this part untill is changed by hacking,just a way to prevent stealing…
If your script is somehow smart enough to know when it has been tampered with, then it can just refuse to continue running in that case. There is nothing to be gained by punishing your users.
If someone can decode your .mse, they can also remove this part of the code, so either way this seems like an exercise in futility.
Just a question – why encrypt a small free tool in the first place?
And even if you have a commercial tool that you are releasing, whatever you do will do nothing to thwart people able to hack your tools. I’d spend the time making the tool better or make the price attractive enough for people to not have to try to steal it. This is not in any way designed to sound negative about what you are trying to create, it’s just that this issue has been discussed many times before with the same conclusion – you will be wasting your time unfortunately…
The free tool is a test version to a test before my commercial version released (the free tool is a part of this commercial one) ,just to test whether it can be cracked and the important is test whether people will interested in it,that happened many years ago,so ,was cracked without any doubt,then ,the commercial one ,also cracked,my commercial script was decrypteed and uploaded as a .ms format,several months later ,a commercial tool has functions more like mine was realeased,I am very very sure was stolen from the uploaded .ms.
I just have a little idea to prevent if that happen again at first,but you and lo are right,so,thanks for your suggestion,I am now give up to “encrypt” via this way.
Btw,LoneRobot,you’re famous,and I am admire you very much. :bowdown:
Also lo,helps me too many times,thanks again!