Click here to Skip to main content
15,886,060 members
Home / Discussions / C#
   

C#

 
Questionhow to send mail with hyperlink and values Pin
treuveni18-Dec-09 10:57
treuveni18-Dec-09 10:57 
AnswerRe: how to send mail with hyperlink and values Pin
Stryder_118-Dec-09 11:13
Stryder_118-Dec-09 11:13 
Questionmanipulate the Title of Application [modified] Pin
Terrakotta00118-Dec-09 10:35
Terrakotta00118-Dec-09 10:35 
AnswerRe: manipulate the Title of Application Pin
DaveyM6918-Dec-09 12:09
professionalDaveyM6918-Dec-09 12:09 
QuestionDoes any one know some decent game programming books? Pin
venomation18-Dec-09 10:31
venomation18-Dec-09 10:31 
AnswerRe: Does any one know some decent game programming books? Pin
Migounette19-Dec-09 7:03
Migounette19-Dec-09 7:03 
QuestionNeed help with CPU app Pin
xploda18-Dec-09 8:02
xploda18-Dec-09 8:02 
QuestionVS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42118-Dec-09 5:18
Tomb42118-Dec-09 5:18 
I receive the following error when trying to DirectoryInfo on a Mapped network drive.

Error in DirectoryInfo. Error: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z:\Tom\import\TxtFiles\Sub1'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)
   at System.IO.DirectoryInfo.GetFiles(String searchPattern)
   at DocumentShuttleService.Service1.DirectoryInfo(String sPath, String sFileSearch)


Note: The same routine works without an error on a local c: drive in the Windows Service.
Also, the same routine works without an error in a Windows Form on a mapped network drive, yet fails in the Windows Service.

Here is the Code snippet of routine.

public Boolean DirectoryInfo(string sPath, string sFileSearch)
{
    try
    {
        Boolean bolFoundAMatch = false;

        if (sPath != string.Empty)
        {
            DirectoryInfo di = new DirectoryInfo(sPath);
            FileInfo[] rgFiles = di.GetFiles(sFileSearch);

            foreach (FileInfo fi in rgFiles)
            {
                bolFoundAMatch = true;
            }

            if (bolFoundAMatch)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
    catch (Exception ex)
    {
        sErrorMessage = "Error in DirectoryInfo. Error: " + ex.GetBaseException().ToString();
        sRetStatusErrorLog = WriteInLog(sErrorMessage);
        return false;
    }
    finally
    {
    }
}

AnswerRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
EliottA18-Dec-09 5:29
EliottA18-Dec-09 5:29 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42118-Dec-09 5:44
Tomb42118-Dec-09 5:44 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Luc Pattyn18-Dec-09 5:50
sitebuilderLuc Pattyn18-Dec-09 5:50 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Dave Kreskowiak18-Dec-09 6:59
mveDave Kreskowiak18-Dec-09 6:59 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42118-Dec-09 8:14
Tomb42118-Dec-09 8:14 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Dave Kreskowiak18-Dec-09 9:30
mveDave Kreskowiak18-Dec-09 9:30 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42118-Dec-09 11:27
Tomb42118-Dec-09 11:27 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Ravi Bhavnani18-Dec-09 16:13
professionalRavi Bhavnani18-Dec-09 16:13 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42121-Dec-09 1:56
Tomb42121-Dec-09 1:56 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Ravi Bhavnani21-Dec-09 6:02
professionalRavi Bhavnani21-Dec-09 6:02 
GeneralRe: VS C# Windows Service - System.IO.DirectoryNotFoundException: Could not find a part of the path Pin
Tomb42124-Dec-09 1:49
Tomb42124-Dec-09 1:49 
Questionc# form on focus Pin
benjamin yap18-Dec-09 5:08
benjamin yap18-Dec-09 5:08 
AnswerRe: c# form on focus Pin
EliottA18-Dec-09 5:28
EliottA18-Dec-09 5:28 
GeneralRe: c# form on focus Pin
benjamin yap18-Dec-09 5:33
benjamin yap18-Dec-09 5:33 
GeneralRe: c# form on focus Pin
EliottA18-Dec-09 5:33
EliottA18-Dec-09 5:33 
GeneralRe: c# form on focus Pin
jashimu18-Dec-09 5:54
jashimu18-Dec-09 5:54 
GeneralRe: c# form on focus Pin
Luc Pattyn18-Dec-09 5:55
sitebuilderLuc Pattyn18-Dec-09 5:55 

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.