Your wants can be fulfilled by easily creating a string variable in My.Settings
but as this is a about licensing,use :
IO.File.WriteAllText(IO.Directory.GetCurrentDirectory + "\license.abc","license string here")
you may even want to encrypt the file,for that :
class Encryptor
{
public static string Key = "license here";
public static string Encrypt (string decrypted)
{
byte[] textbytes = ASCIIEncoding.ASCII.GetBytes(decrypted);
AesCryptoServiceProvider endec = new AesCryptoServiceProvider();
endec.BlockSize = 128;
endec.KeySize = 256;
endec.Key = ASCIIEncoding.ASCII.GetBytes(Key);
endec.Padding = PaddingMode.PKCS7;
endec.Mode = CipherMode.CBC;
ICryptoTransform icrypt = endec.CreateEncryptor(endec.Key);
byte[] enc = icrypt.TransformFinalBlock(textbytes, 0, textbytes.Length);
icrypt.Dispose();
return Convert.ToBase64String(enc);
}
Another bet would be store the license in registry :
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("key");
key.SetValue("key", "licenseKeyHere");
key.Close();
Your best bet is to let the activation happen online,let it connect to your database over the net and activate.You can go with SQL Server,MySql or other similar products.
And one more thing,as u mentioned in ur qs,u want to embed a file to the app so tht the user can't see it ? Why not, use my 1st/2nd method and finally do this :
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);