arkadaşlar şu kodu c++ diline çevirebilecek var mı üniversitede ödev için lazım acil teslim etmeliyim program şöyle olucak mantığını anlatıyım
openfiledialog kullanarak bi txt dosyası seçtircez dosyada her satırda 1 sayı olucak ve program bu sayıların her birine 5 ekleyerek aynı düzende savefiledialog kullanarak farklı bi txt dosyasına yazdırcak bu arada open yaptığımız dosyada kaç satır olduğunu biz yazmıycaz program kendisi anlıycak şimdiden teşekkürler ilgilenenlere
using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using System.IO; namespace c_v_c {
public partial class MainForm : Form { public MainForm() {
}
List<string> lines = new List<string>(); string line;
void Button1Click(object sender, System.EventArgs e) { openFileDialog1.FileName=""; openFileDialog1.Filter="(*.txt)|*.txt"; if (openFileDialog1.ShowDialog()==DialogResult.OK) { using (StreamReader sr = new StreamReader(openFileDialog1.FileName.ToString())) {
while ((line = sr.ReadLine()) != null) { line=(Convert.ToInt32(line)+5).ToString(); lines.Add(line); }
saveFileDialog1.FileName=""; saveFileDialog1.Filter="(*.txt)|*.txt"; if (saveFileDialog1.ShowDialog()==DialogResult.OK) { using(StreamWriter Kaydet = new StreamWriter(saveFileDialog1.FileName))
openfiledialog kullanarak bi txt dosyası seçtircez dosyada her satırda 1 sayı olucak ve program bu sayıların her birine 5 ekleyerek aynı düzende savefiledialog kullanarak farklı bi txt dosyasına yazdırcak bu arada open yaptığımız dosyada kaç satır olduğunu biz yazmıycaz program kendisi anlıycak şimdiden teşekkürler ilgilenenlere
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace c_v_c
{
public partial class MainForm : Form
{
public MainForm()
{
}
List<string> lines = new List<string>();
string line;
void Button1Click(object sender, System.EventArgs e)
{
openFileDialog1.FileName="";
openFileDialog1.Filter="(*.txt)|*.txt";
if (openFileDialog1.ShowDialog()==DialogResult.OK)
{
using (StreamReader sr = new StreamReader(openFileDialog1.FileName.ToString()))
{
while ((line = sr.ReadLine()) != null)
{
line=(Convert.ToInt32(line)+5).ToString();
lines.Add(line);
}
saveFileDialog1.FileName="";
saveFileDialog1.Filter="(*.txt)|*.txt";
if (saveFileDialog1.ShowDialog()==DialogResult.OK)
{
using(StreamWriter Kaydet = new StreamWriter(saveFileDialog1.FileName))
foreach (string s in lines)
{
Kaydet.WriteLine(s);
}
}
}
}
}
}
}