KONU : C Sharp Uygulamalar - C Sharp ( C# ) bir uygulamanın kısayolunu oluşturma. Bir uygulamayı bilgisayar başlarken çalıştırma.
ETİKETLER: c sharp shortcut - c sharp kısayol oluşturma - c sharp application shortcut - c# application shortcut - c sharp uygulama kısayol oluşturma - c# uygulama kısayol oluşturma - kısayol oluşturma programı - create application shortcut - c sharp shortcut create - c sharp shortcuts - c# shortcut - create shortcut - create shortcuts
UYGULAMAYI İNDİR
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using IWshRuntimeLibrary;
namespace C_Sharp_Run_Exe_Startup
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//startup adresini string tipinde bir değişkene atayalım
string startUpPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
//WshShell den bir örnek oluşturalım
WshShell shell = new WshShell();
// kısa yolu oluşturacağımız adresi bir string değişkene atayalım
string shortcutAddress = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + @"\HesapMakinesi.lnk";
//kısayol adresinden kısayol nesnesini oluşturalım
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
shortcut.Description = "Hesap Makinesi Kısayolu";
//kısa yolun açacağı uygulamanın adresini kısayol nesnesinin hedef adresine atayalım
shortcut.TargetPath = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\calc.exe";
//Kısayolu oluşturmak için save metodunu çalıştıralım.
shortcut.Save();
}
}
}
UYGULAMAYI İNDİR
Hiç yorum yok :
Yorum Gönder