This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomRandom { | |
constructor() { | |
this.seed = this.#getMillisecondsArray(); | |
} | |
#getMillisecondsArray() { | |
return [...(new Date).getMilliseconds().toString()].map(Number); | |
} | |
random() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let max = array.reduce((p, n)=> p > n ? p : n ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Kullanımı: | |
MessageBoxManager.OK = "&Siteye Git..."; | |
MessageBoxManager.Cancel = "&Tamam"; | |
MessageBoxManager.Register(); | |
DialogResult git = MessageBox.Show("Bu program null tarafından yapılmıştır.\nDestek almak ya da görüşlerinizi bildirmek için www.nullovy.com sitesine gidebilirsiniz.", "Hakkında", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk); | |
MessageBoxManager.Unregister(); | |
if (git == System.Windows.Forms.DialogResult.OK) | |
{ | |
System.Diagnostics.Process.Start("http://www.nullovy.com"); | |
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Drawing; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Windows.Forms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Kullanıcının yönetici olup olmadığını öğrenme | |
public static bool IsAdministrator() | |
{ | |
return (new WindowsPrincipal(WindowsIdentity.GetCurrent())) | |
.IsInRole(WindowsBuiltInRole.Administrator); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bilgisayar servislerine erişme | |
public static void RestartService(string serviceName) | |
{ | |
ServiceController service = new ServiceController(serviceName); | |
try | |
{ | |
//Durdur | |
service.Stop(); | |
service.WaitForStatus(ServiceControllerStatus.Stopped); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Arka plan değiştirme | |
[DllImport("user32.dll", CharSet = CharSet.Auto)] | |
private static extern Int32 SystemParametersInfo(UInt32 action, UInt32 uParam, String vParam, UInt32 winIni); | |
public void SetWallpaper(String path) //Arka planı ayarlamak için | |
{ | |
SystemParametersInfo(0x14, 0, path, 0x01 | 0x02); | |
} | |
SetWallpaper("yol/arkaplan"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Resmi blur yapma | |
private Bitmap Blur(Image img) | |
{ | |
Bitmap pic = new Bitmap(img); | |
for (int w = 0; w < pic.Width; w++) | |
{ | |
for (int h = 0; h < pic.Height; h++) | |
{ | |
Color c = pic.GetPixel(w, h); | |
Color newC = Color.FromArgb(80, c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Kopyalama bilgileri | |
Clipboard.ContainsText(); //Panoda kopya var mı | |
Clipboard.GetText(); //Panodaki texti ver | |
Clipboard.ContainsImage(); //Panoda resim var mı | |
Clipboard.GetImage(); //Panodaki resimi ver | |
Clipboard.ContainsFileDropList(); //Panoda dosya var mı | |
Clipboard.GetFileDropList(); //Panodaki dosya listesini ver | |
Clipboard.SetText("metin"); //Panodaki kopyayı değiştir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void WndProc(ref Message m) //Form sürüklemesini kapat | |
{ | |
const int WM_SYSCOMMAND = 0x0112; | |
const int SC_MOVE = 0xF010; | |
switch (m.Msg) | |
{ | |
case WM_SYSCOMMAND: | |
int command = m.WParam.ToInt32() & 0xfff0; | |
if (command == SC_MOVE) |
NewerOlder