Click here to Skip to main content
15,881,715 members
Home / Discussions / C#
   

C#

 
Questionwindows version check Pin
shabya28-Feb-09 7:26
shabya28-Feb-09 7:26 
AnswerRe: windows version check Pin
harold aptroot28-Feb-09 7:30
harold aptroot28-Feb-09 7:30 
GeneralRe: windows version check Pin
0x3c028-Feb-09 8:15
0x3c028-Feb-09 8:15 
GeneralRe: windows version check Pin
harold aptroot28-Feb-09 8:42
harold aptroot28-Feb-09 8:42 
GeneralRe: windows version check Pin
shabya28-Feb-09 9:36
shabya28-Feb-09 9:36 
GeneralRe: windows version check Pin
harold aptroot28-Feb-09 10:17
harold aptroot28-Feb-09 10:17 
AnswerRe: windows version check Pin
Ravi Bhavnani28-Feb-09 8:48
professionalRavi Bhavnani28-Feb-09 8:48 
QuestionStrip progress bar using background thread while uploading file in C#? Pin
rasingh128-Feb-09 7:10
rasingh128-Feb-09 7:10 
I want to run a strip progress bar on winform using background thread while uploading a file from my hard disk.i am getting an exception on xmlDocument.Load(txtFileName.Text) saying " System.ArgumentException was unhandled by user code Message="Illegal characters in path."
public partial class TreeDisplay : Form  
    {  
        public string Filename  
        {            get { return filename; }        }  
        protected string filename;  
        //Declaring constructor of the Class  
        public TreeDisplay()  
        {  
            InitializeComponent();  
            this.Text = "Tree View of XML File";//Form Title.  
        }//TreeDisplay Constructor  
        private void initiatingTree(string nameofFile)  
        {  
            try 
            {              
                treeView1.Nodes.Clear();  
                if (xmlDocument.DocumentElement != null) treeView1.Nodes.Add(new TreeNode(xmlDocument.DocumentElement.Name));  
                //Creating TreeNode and adding the first node to it.  
                TreeNode tNodeObj = treeView1.Nodes[0];  
                                 
                XmlNode xNode = xmlDocument.DocumentElement;  
 
                //Declaring function for adding Nodes to tree View.  
                AddingNodesToTree(xNode,tNodeObj);  
                toolStripStatusLabel1.Text = "Opened file " + nameofFile;  
                treeView1.Nodes[0].Expand();  
                treeView1.CollapseAll();  
            }//try block ends  
            //Exception Handlers to catch any sort of error  
            catch (XmlException xmlex)  
            {  
                MessageBox.Show(xmlex.Message, "Error");  
            }//catch  
            catch (Exception exp)  
            {  
                txtFileName.Text = exp.Message;  
            }  
        }//initiatingTree  
private void btnBrowse_Click(object sender,EventArgs e)
        {
            bgWorker1.RunWorkerAsync();
            StripProgressBar.Value = 0;
            toolStripStatusLabel1.Text = "Browsing for a  Xml file";
            OpenFileDialog open = new OpenFileDialog();
            
            if (open.ShowDialog(this) == DialogResult.OK)
            {
                txtFileName.Text = open.FileName;
                initiatingTree(open.FileName); 
            }
            while (this.bgWorker1.IsBusy)
            {
                StripProgressBar.Increment(1);
                Application.DoEvents();
            }
        }//Browse button      
        private void bgWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            xmlDocument = new XmlDocument();
            Thread.Sleep(5000);
            xmlDocument.Load(txtFileName.Text);
            btnBrowse.Enabled = false;
        }
        private void bgworker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
             StripProgressBar.Value = 100;
             if (e.Error == null)
             {
                 MessageBox.Show(xmlDocument.InnerXml, "Download Complete");
             }
             else
             {
                 MessageBox.Show("Failed to download file");                    
             }
             // Enable the Browse button and reset the progress bar.
             this.btnBrowse.Enabled = true;
             StripProgressBar.Value = 0;
             toolStripStatusLabel1.Text = "work finished processing request.";  
         }//workerCompleted  
    }// TreeDisplay Class  

Please help me in removing the exception.
Thanks..
AnswerRe: Strip progress bar using background thread while uploading file in C#? Pin
Ravi Bhavnani28-Feb-09 8:49
professionalRavi Bhavnani28-Feb-09 8:49 
QuestionRe: Strip progress bar using background thread while uploading file in C#? Pin
rasingh128-Feb-09 20:18
rasingh128-Feb-09 20:18 
AnswerRe: Strip progress bar using background thread while uploading file in C#? Pin
Ravi Bhavnani28-Feb-09 20:24
professionalRavi Bhavnani28-Feb-09 20:24 
GeneralRe: Strip progress bar using background thread while uploading file in C#? Pin
rasingh12-Mar-09 0:42
rasingh12-Mar-09 0:42 
GeneralRe: Strip progress bar using background thread while uploading file in C#? Pin
Ravi Bhavnani2-Mar-09 3:44
professionalRavi Bhavnani2-Mar-09 3:44 
GeneralRe: Strip progress bar using background thread while uploading file in C#? Pin
rasingh14-Mar-09 17:10
rasingh14-Mar-09 17:10 
GeneralRe: Strip progress bar using background thread while uploading file in C#? Pin
Ravi Bhavnani4-Mar-09 17:47
professionalRavi Bhavnani4-Mar-09 17:47 
GeneralRe: Strip progress bar using background thread while uploading file in C#? Pin
rasingh14-Mar-09 18:27
rasingh14-Mar-09 18:27 
QuestionFile caching C# Pin
satsumatable28-Feb-09 5:53
satsumatable28-Feb-09 5:53 
AnswerRe: File caching C# Pin
harold aptroot28-Feb-09 6:24
harold aptroot28-Feb-09 6:24 
QuestionI need real help from some of you! thanks. Pin
Seraph_summer28-Feb-09 4:18
Seraph_summer28-Feb-09 4:18 
AnswerRe: I need real help from some of you! thanks. Pin
Henry Minute1-Mar-09 2:10
Henry Minute1-Mar-09 2:10 
Questionhow to do the custom deployment of c# .net windows applications project ? Pin
pramod251728-Feb-09 4:10
pramod251728-Feb-09 4:10 
AnswerRe: how to do the custom deployment of c# .net windows applications project ? Pin
Calin Tatar28-Feb-09 4:16
Calin Tatar28-Feb-09 4:16 
GeneralRe: how to do the custom deployment of c# .net windows applications project ? Pin
pramod251728-Feb-09 5:51
pramod251728-Feb-09 5:51 
GeneralRe: how to do the custom deployment of c# .net windows applications project ? Pin
Calin Tatar28-Feb-09 13:17
Calin Tatar28-Feb-09 13:17 
QuestionProblem with Matrix control for rdlc file in win forms Pin
Member 305788728-Feb-09 3:32
Member 305788728-Feb-09 3:32 

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.