public void gerarJson() { CookieDAO cdao = new CookieDAO(); DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(List <CookieClass>)); diretorioExiste(); FileStream fs = new FileStream(@"C:\Cookie\cookie.json", FileMode.OpenOrCreate); ser.WriteObject(fs, cdao.listarCookie()); fs.Close(); MessageBox.Show("Arquivo criado !! - C:\\Cookie\\cookie.json"); }
public ListarCookies() { InitializeComponent(); cookies = new CookieDAO(); dgCookies.ItemsSource = cookies.listarCookie(); }