اMSA
اMSA
CC#
Created by اMSA on 2/9/2023 in #help
❔ broken c# (its a large code explained)
using System.Runtime.InteropServices;
using System.Text;

public class Program
{
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,string key,string def,StringBuilder retVal,int size,string filePath);

[DllImport("kernel32.dll")]
public static extern void GetSystemTimeAsFileTime(out long systemTimeAsFileTime);

public static void Main()
{
long time;
GetSystemTimeAsFileTime(out time);

var RetVal = new StringBuilder(255);
GetPrivateProfileString("since_start", "gather", "" , RetVal, 255, "./timer.ini");

long last = long.Parse(RetVal.ToString());

string old = System.Windows.Forms.Clipboard.GetText();
if (time - last >= 6000000000) System.Windows.Forms.Clipboard.SetText("end");
}
}
using System.Runtime.InteropServices;
using System.Text;

public class Program
{
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,string key,string def,StringBuilder retVal,int size,string filePath);

[DllImport("kernel32.dll")]
public static extern void GetSystemTimeAsFileTime(out long systemTimeAsFileTime);

public static void Main()
{
long time;
GetSystemTimeAsFileTime(out time);

var RetVal = new StringBuilder(255);
GetPrivateProfileString("since_start", "gather", "" , RetVal, 255, "./timer.ini");

long last = long.Parse(RetVal.ToString());

string old = System.Windows.Forms.Clipboard.GetText();
if (time - last >= 6000000000) System.Windows.Forms.Clipboard.SetText("end");
}
}
33 replies