using System.Reflection;
Build Action
, значение Embedded Resource
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "MyCompany.MyProduct.MyFile.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
}
while (true)
{
if (int1 > 20)
{
//код
}
if (int2 > 400)
{
//код
}
if (int3 > 300)
{
//код
}
System.Threading.Thread.Sleep(200000);
}
big endian to little endian online
и воспользоваться одной из ссылокtry
{
string login = "serega404"; // если в базе нет этого ника то мы получаем исключение
string CommandText = "SELECT money FROM users WHERE login = '" + login + "'";
string Connect = "Database=bd;Data Source=localhost;User Id=root;Password=;SslMode=none";
MySqlConnection myConnection = new MySqlConnection(Connect);
MySqlCommand myCommand = new MySqlCommand(CommandText, myConnection);
myConnection.Open();
string money = myCommand.ExecuteScalar().ToString();
myConnection.Close();
return money;
}
catch (Exception ex)
{
Console.WriteLine("Ахтунг, нету такого: " + ex.Message);
}
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string className, string windowTitle);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool ShowWindow(IntPtr hWnd, ShowWindowEnum flags);
[DllImport("user32.dll")]
private static extern int SetForegroundWindow(IntPtr hwnd);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetWindowPlacement(IntPtr hWnd, ref Windowplacement lpwndpl);
private enum ShowWindowEnum
{
Hide = 0,
ShowNormal = 1, ShowMinimized = 2, ShowMaximized = 3,
Maximize = 3, ShowNormalNoActivate = 4, Show = 5,
Minimize = 6, ShowMinNoActivate = 7, ShowNoActivate = 8,
Restore = 9, ShowDefault = 10, ForceMinimized = 11
};
private struct Windowplacement
{
public int length;
public int flags;
public int showCmd;
public System.Drawing.Point ptMinPosition;
public System.Drawing.Point ptMaxPosition;
public System.Drawing.Rectangle rcNormalPosition;
}
private void BringWindowToFront()
{
IntPtr wdwIntPtr = FindWindow(null, "Put_your_window_title_here");
//get the hWnd of the process
Windowplacement placement = new Windowplacement();
GetWindowPlacement(wdwIntPtr, ref placement);
// Check if window is minimized
if (placement.showCmd == 2)
{
//the window is hidden so we restore it
ShowWindow(wdwIntPtr, ShowWindowEnum.Restore);
}
//set user focus to the window
SetForegroundWindow(wdwIntPtr);
}
public static byte[] encode(String pText, String pKey) {
byte[] txt = pText.getBytes();
byte[] key = pKey.getBytes();
byte[] res = new byte[pText.length()];
for (int i = 0; i < txt.length; i++) {
res[i] = (byte) (txt[i] ^ key[i % key.length]);
}
return res;
}
public static String decode(byte[] pText, String pKey) {
byte[] res = new byte[pText.length];
byte[] key = pKey.getBytes();
for (int i = 0; i < pText.length; i++) {
res[i] = (byte) (pText[i] ^ key[i % key.length]);
}
return new String(res);
}