This is the first time I'm using csv and c#.
This is the code, its running, and creating the csv, but it doesn't write anything.
The code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace csv
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
TextWriter sw = new StreamWriter("C:\\Data.csv");
string Var1 = "5";
string Var2 = "325,22";
private void button1_Click(object sender, EventArgs e)
{
sw.WriteLine("{0}","{2}", Var1,Var2);
}
}