Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
Questionproblem with custom serialization in .net 2.0 Pin
prasadbuddhika31-Dec-09 1:48
prasadbuddhika31-Dec-09 1:48 
AnswerRe: problem with custom serialization in .net 2.0 Pin
Paul Unsworth31-Dec-09 2:00
Paul Unsworth31-Dec-09 2:00 
AnswerRe: problem with custom serialization in .net 2.0 Pin
Abhinav S31-Dec-09 3:14
Abhinav S31-Dec-09 3:14 
GeneralRe: problem with custom serialization in .net 2.0 Pin
prasadbuddhika31-Dec-09 19:14
prasadbuddhika31-Dec-09 19:14 
Question"The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 0:25
sri_346431-Dec-09 0:25 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Rob Philpott31-Dec-09 0:42
Rob Philpott31-Dec-09 0:42 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 0:46
professionalKeith Barrow31-Dec-09 0:46 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 0:52
sri_346431-Dec-09 0:52 
Service1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Configuration;

namespace FileTransfer
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                FileTransferWatcher.Created += new System.IO.FileSystemEventHandler(FileTransferWatcher_Created);
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry("Message :  " + ex.Message);
            }
        }

        void FileTransferWatcher_Created(object sender, System.IO.FileSystemEventArgs e)
        {
            System.IO.File.Copy(e.FullPath, @"D:\");
        }

        protected override void OnStop()
        {
        }
    }
}

Service1.Designer.cs
namespace FileTransfer
{
    partial class Service1
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.FileTransferWatcher = new System.IO.FileSystemWatcher();
            // 
            // FileTransferWatcher
            // 
            this.FileTransferWatcher.EnableRaisingEvents = true;
            this.FileTransferWatcher.Path = "D:\\Test\\";
            // 
            // Service1
            // 
            this.ServiceName = "FileTransfer";

        }

        #endregion

        private System.IO.FileSystemWatcher FileTransferWatcher;
    }
}

The bolder statement is were the exception is thrown.
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 1:09
professionalKeith Barrow31-Dec-09 1:09 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 3:24
sri_346431-Dec-09 3:24 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
0x3c031-Dec-09 2:25
0x3c031-Dec-09 2:25 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Thomas Krojer31-Dec-09 3:05
Thomas Krojer31-Dec-09 3:05 
Questionproblem with RSS feed - pubDate Pin
CrimeanTurtle200831-Dec-09 0:16
CrimeanTurtle200831-Dec-09 0:16 
AnswerRe: problem with RSS feed - pubDate [modified] Pin
ProtoBytes31-Dec-09 3:48
ProtoBytes31-Dec-09 3:48 
QuestionInternet explorer HTTP Authentication - sending or storing headers Pin
Vijayanand Settin30-Dec-09 23:32
Vijayanand Settin30-Dec-09 23:32 
AnswerRe: Internet explorer HTTP Authentication - sending or storing headers Pin
Sipder31-Dec-09 1:40
Sipder31-Dec-09 1:40 
GeneralRe: Internet explorer HTTP Authentication - sending or storing headers Pin
Vijayanand Settin4-Jan-10 1:36
Vijayanand Settin4-Jan-10 1:36 
QuestionSpelling checker Pin
linatta30-Dec-09 23:00
linatta30-Dec-09 23:00 
AnswerRe: Spelling checker Pin
Ravi Bhavnani31-Dec-09 16:34
professionalRavi Bhavnani31-Dec-09 16:34 
GeneralRe: Spelling checker Pin
linatta31-Dec-09 21:02
linatta31-Dec-09 21:02 
Questionfacing problems with Dictonary object Pin
yadlaprasad30-Dec-09 22:34
yadlaprasad30-Dec-09 22:34 
AnswerRe: facing problems with Dictonary object Pin
Abhinav S30-Dec-09 22:56
Abhinav S30-Dec-09 22:56 
AnswerRe: facing problems with Dictonary object Pin
OriginalGriff31-Dec-09 1:36
mveOriginalGriff31-Dec-09 1:36 
Questiongraphic Pin
jartrini30-Dec-09 22:14
jartrini30-Dec-09 22:14 
QuestionFile Problem in VISTA Pin
Wamuti30-Dec-09 21:31
Wamuti30-Dec-09 21:31 

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.