private void historyin() { IO.StreamWriter w = default(IO.StreamWriter); Hist.ListBox1.Items.Add(((WebBrowser)TabControl1.SelectedTab.Controls.Item(0)).DocumentTitle); Hist.ListBox2.Items.Add(ComboBox1.Text); //Saving History int i = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\History1.gwbb"); for (i = 0; i <= Hist.ListBox1.Items.Count - 1; i++) { w.WriteLine(Hist.ListBox1.Items.Item(i)); } w.Close(); // int ii = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\History2.gwbb"); for (ii = 0; ii <= Hist.ListBox2.Items.Count - 1; ii++) { w.WriteLine(Hist.ListBox2.Items.Item(ii)); } w.Close(); }
public WebServerRequestContext(HttpListenerContext context) { this.context = context; this._header = context.Response.Headers; this.writer = new IO.StreamWriter(context.Response.OutputStream); InitializerInputStream(context); }
private void Button1_Click(System.Object sender, System.EventArgs e) { IO.StreamWriter w = default(IO.StreamWriter); try { int i = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks.gwbb"); for (i = 0; i <= ListBox1.Items.Count - 1; i++) { w.WriteLine(ListBox1.Items.Item(i)); } w.Close(); } catch (Exception ex) { } try { int i = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks2.gwbb"); for (i = 0; i <= ListBox2.Items.Count - 1; i++) { w.WriteLine(ListBox2.Items.Item(i)); } w.Close(); } catch (Exception ex) { } }
private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { int i = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks.gwbb"); for (i = 0; i <= Bookmarks.ListBox1.Items.Count - 1; i++) { w.WriteLine(Bookmarks.ListBox1.Items.Item(i)); } w.Close(); this.Enabled = false; exit_page.Show(); }
private void Button1_Click(System.Object sender, System.EventArgs e) { dynamic headers = (from header in DataGridView1.Columns.Cast <DataGridViewColumn>() header.HeaderText).ToArray; dynamic rows = from row in DataGridView1.Rows.Cast <DataGridViewRow>() where !row.IsNewRowArray.ConvertAll(row.Cells.Cast <DataGridViewCell> .ToArray, c => c.Value != null ? c.Value.ToString : ""); string str = ""; using (IO.StreamWriter sw = new IO.StreamWriter("C:\\Users\\Excel\\Desktop\\OrdersTest.csv")) { sw.WriteLine(string.Join(",", headers)); //sw.WriteLine(String.Join(",")) foreach (void r_loopVariable in rows) { r = r_loopVariable; sw.WriteLine(string.Join(",", r)); } sw.Close(); } }
private void save() { int i = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\History1.gwbb"); for (i = 0; i <= ListBox1.Items.Count - 1; i++) { w.WriteLine(ListBox1.Items.Item(i)); } w.Close(); // int ii = 0; w = new IO.StreamWriter("C:\\CoderRevolt\\WebBrowser\\V1\\History2.gwbb"); for (ii = 0; ii <= ListBox1.Items.Count - 1; ii++) { w.WriteLine(ListBox1.Items.Item(ii)); } w.Close(); }
/// <summary> /// Saves the mesh to wavefront(.obj) file format that allows /// to analyze the geometry with other very powerful tools /// </summary> /// <param name="mesh">Mesh geometry</param> /// <param name="path">Filename</param> public static void SaveToWavefrontObj(this MeshGeometry3D mesh, string path) { using (var writer = new IO.StreamWriter(path, false, Text.Encoding.ASCII)) { var format = System.Globalization.CultureInfo.InvariantCulture; foreach (Point3D position in mesh.Positions) { writer.WriteLine("v {0} {1} {2}", position.X.ToString(format), position.Y.ToString(format), position.Z.ToString(format)); } foreach (Vector3D normals in mesh.Normals) { writer.WriteLine("vn {0} {1} {2}", normals.X.ToString(format), normals.Y.ToString(format), normals.Z.ToString(format)); } foreach (Point textureCoordinate in mesh.TextureCoordinates) { writer.WriteLine("vt {0} {1}", textureCoordinate.X.ToString(format), textureCoordinate.Y.ToString(format)); } string formatString; if (mesh.TextureCoordinates.Count == mesh.Positions.Count) { if (mesh.Normals.Count == mesh.Positions.Count) formatString = "f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}"; else formatString = "f {0}/{0} {1}/{1} {2}/{2}"; } else { if (mesh.Normals.Count == mesh.Positions.Count) formatString = "f {0}//{0} {1}//{1} {2}//{2}"; else formatString = "f {0} {1} {2}"; } for (int i = 2; i < mesh.TriangleIndices.Count; i += 3) { writer.WriteLine(formatString, (mesh.TriangleIndices[i - 2] + 1).ToString(format), (mesh.TriangleIndices[i - 1] + 1).ToString(format), (mesh.TriangleIndices[i] + 1).ToString(format)); } } }
public void AddFile(string _file) { IO.StreamWriter writer = new IO.StreamWriter(_file) m_Outputs.Add(writer); }
public void AddOutput(string _token, string _file) { IO.StreamWriter writer = new IO.StreamWriter(_file) m_Outputs[_token] = writer; }