KAYNAK KODLARI:
using System;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string dosya;
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
dosya = openFileDialog1.FileName;
}
}
private void Form1_Load(object sender, EventArgs e)
{
openFileDialog1.Filter = "Metin Belgeleri | *.txt";
openFileDialog1.Title = "Dosya Seç";
openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
}
private void button2_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBox1.Text) && !string.IsNullOrWhiteSpace(dosya))
{
string[] satirlar = File.ReadAllLines(dosya);
for (int i = 0; i < satirlar.Length; i++)
{
satirlar[i] += ":" + textBox1.Text;
}
File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\yeniDosya.txt", satirlar);
MessageBox.Show("Yeni Metin Belgesi Oluşturuldu.nKayıt Yeri:t" + Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\yeniDosya.txt", "İşlem Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show("Dosya Seçilmedi veya Port Yazılmadı !", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}Yapmanız Gereken Visual Studio'da yeni bir Form açıp bi textbox, 2 buton, 1 openfiledialog eklemeniz ve yukarıdaki kaynak kodu ilgili yönlendiricilere eklemeniz.
Visual Studio'ya erişiminiz yoksa uygulamayı
https://drive.google.com/open?id=1xQ...cR2A-ObU6VTPnf buradan indirebilirsiniz.