Click here to Skip to main content
16,006,605 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# audio conferencing Pin
Unsy21-Jan-09 4:18
Unsy21-Jan-09 4:18 
GeneralRe: C# audio conferencing Pin
musefan21-Jan-09 4:33
musefan21-Jan-09 4:33 
AnswerRe: C# audio conferencing Pin
Irfan alam15-Feb-10 20:44
Irfan alam15-Feb-10 20:44 
AnswerRe: C# audio conferencing Pin
bbirajdar9-Jan-12 4:39
bbirajdar9-Jan-12 4:39 
QuestionHow handle cross thread bug Pin
anishkannan20-Jan-09 20:17
anishkannan20-Jan-09 20:17 
AnswerRe: How handle cross thread bug Pin
Giorgi Dalakishvili20-Jan-09 20:41
mentorGiorgi Dalakishvili20-Jan-09 20:41 
AnswerRe: How handle cross thread bug Pin
Irfan alam15-Feb-10 20:47
Irfan alam15-Feb-10 20:47 
QuestionHelp me Pin
Tuntgerhuu20-Jan-09 19:44
Tuntgerhuu20-Jan-09 19:44 
//Mainform.cs
***********************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Timers;

namespace CAM_XML2SQLiteModule
{
public partial class Mainform : Form
{

public Mainform()
{
InitializeComponent();
}

private void Mainform_Load(object sender, EventArgs e)
{
ProgressBar.Visible = false;
StatusLabel.Visible = false;
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
timer1.Stop();
ProgressBar.Visible = false;
Application.Exit();
}

private void srtbutton_Click(object sender, EventArgs e)
{
srtbutton.Enabled = false;
timer1.Interval = (3000); //4000 milloseconds = 4 seconds
ProgressBar.Visible = true;
StatusLabel.Visible = true;
StatusLabel.Text = "Starting";
timer1.Enabled = true;
}


private void timer1_Tick(object sender, EventArgs e)
{
XMLstore_monitor xsmc = new XMLstore_monitor(); //Error 1: No overload for method 'XMLstore_monitor' takes '0' arguments
xsmc.XSMonitor();

}

}
}
*********************************************

//XMLstore_monitor.cs
******************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace CAM_XML2SQLiteModule
{
class XMLstore_monitor
{
public XMLstore_monitor(ListView listview, TextBox DmTextBox)
{
lsvXML = listview;
dmtxtBox = DmTextBox;
}
private ListView lsvXML;
private TextBox dmtxtBox;

public void XSMonitor()
{
DirectoryInfo xmlfile = new DirectoryInfo(dmtxtBox.Text);
// Set up the listview control.
ListViewItem myItem = new ListViewItem();

lsvXML.Columns.Clear();
lsvXML.Items.Clear();
lsvXML.Columns.Add("givenname", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("surname", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("streetname", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("number", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("city", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("postalcode", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("mobile1", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("mobile2", 80, HorizontalAlignment.Left);
lsvXML.Columns.Add("mail", 80, HorizontalAlignment.Left);
// The xml node reader.
XmlNodeReader reader = null;

try
{
string s = "";
// The xml document to read from.
XmlDocument doc = new XmlDocument();

foreach (FileInfo file in xmlfile.GetFiles("*.xml"))
{
// Load the xml document.
doc.Load(dmtxtBox.Text + (file.Name));
}

// Set the reader to open the xml document.
reader = new XmlNodeReader(doc);

// Read all the data in the XML document and display it.
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
s = reader.Name;
break;
case XmlNodeType.Text:
if (s.Equals("givenname"))
// With the first name add a line to the listview control.
myItem = lsvXML.Items.Add(reader.Value);
else
myItem.SubItems.Add(reader.Value);
break;
}
}
}
catch (System.IO.FileNotFoundException)
{

}
finally
{
if (reader != null)
reader.Close();
}
foreach (FileInfo file in xmlfile.GetFiles("*.xml"))
{
// Remove the found XML file after reading
File.Delete(dmtxtBox.Text + (file.Name));
}
}
}
}
AnswerRe: Help me Pin
dan!sh 20-Jan-09 20:05
professional dan!sh 20-Jan-09 20:05 
AnswerRe: Help me Pin
J4amieC20-Jan-09 22:14
J4amieC20-Jan-09 22:14 
AnswerRe: Help me Pin
Pete O'Hanlon20-Jan-09 22:35
mvePete O'Hanlon20-Jan-09 22:35 
AnswerRe: Help me Pin
#realJSOP20-Jan-09 23:25
professional#realJSOP20-Jan-09 23:25 
GeneralRe: Help me Pin
benjymous20-Jan-09 23:47
benjymous20-Jan-09 23:47 
GeneralRe: Help me Pin
DaveyM6920-Jan-09 23:53
professionalDaveyM6920-Jan-09 23:53 
GeneralAgain. Pin
CPallini21-Jan-09 0:37
mveCPallini21-Jan-09 0:37 
GeneralRe: Again. Pin
#realJSOP21-Jan-09 7:39
professional#realJSOP21-Jan-09 7:39 
GeneralRe: Again. Pin
Rajesh R Subramanian14-Feb-09 4:10
professionalRajesh R Subramanian14-Feb-09 4:10 
GeneralRe: Help me Pin
Lutosław21-Jan-09 1:20
Lutosław21-Jan-09 1:20 
QuestionHow to reduce CPU usage? Pin
svt gdwl20-Jan-09 19:16
svt gdwl20-Jan-09 19:16 
AnswerRe: How to reduce CPU usage? Pin
N a v a n e e t h20-Jan-09 21:25
N a v a n e e t h20-Jan-09 21:25 
QuestionHow To create a runtime Menu with 3 level using Menu Control in ASP.NET and C#. Pin
Ravi Munde20-Jan-09 19:07
Ravi Munde20-Jan-09 19:07 
AnswerRe: How To create a runtime Menu with 3 level using Menu Control in ASP.NET and C#. Pin
N a v a n e e t h20-Jan-09 21:27
N a v a n e e t h20-Jan-09 21:27 
AnswerRe: How To create a runtime Menu with 3 level using Menu Control in ASP.NET and C#. Pin
SeMartens20-Jan-09 21:27
SeMartens20-Jan-09 21:27 
QuestionError installing application in some machines Pin
Harikrk20-Jan-09 19:01
Harikrk20-Jan-09 19:01 
AnswerRe: Error installing application in some machines Pin
N a v a n e e t h20-Jan-09 21:28
N a v a n e e t h20-Jan-09 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.