Could not find path error

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Could not find path error

    Hi all,
    I am referring to this article in MSDN :
    [url]http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp[/url]

    While creating folder on the remote machine, we are specifying the UNC path
    as per the example. But we get this error "could not find a part of the
    path".

    we are prefixing the path with @ symbol and also tried with the escaping the
    "\\".
    Path is correct and and all the permissions have been granted. ASP.net
    application and the remote folder machine are in the same domain. We tried
    with mapped drive as well , it did't work.

    We are trying out the sample application you have sent. CreateFolder method
    is invoked from the Default.appx.cs file's Page_load method and remote
    folder path is passed to the CreateFolder method and it is shown below.

    CreateFolder(@"\\mypath\shared", "IOFolder");
    Here mypath is the remote machine and is in the same domain of Web
    application. "shared" folder is shared for everyone and full access has been
    given to all the users.

    Below is the code snippet from the CreateFolder Method

    try

    {

    DirectoryInfo dirInfo = new DirectoryInfo(strTragetLocation);

    Response.Write(dirInfo.Exists);

    string strFolderToCreate = strTragetLocation + "\\" + strFolder;

    Directory.CreateDirectory(strFolderToCreate);

    }

    catch (Exception ex)

    {

    Response.Write(ex.Message);

    return false;

    }

    In the above code DirectoryInfo.Exists method returns false and after that
    it tries to CreateDirectory and it throws the following exception "Could not
    find a part of the path \"\\\\mypath\\shared\."."

    Any ideas ?




    Steve Guest

  2. Similar Questions and Discussions

    1. Find COM component path in ASP
      I'm currently trying to move an existing ASP site to a new server. I need to find all of the dependant COM components and their path on the old...
    2. Error: Could not find a part of the path / Reading and Writing to files in ASP.Net
      Hello, I'm trying to read a text file located in the top folder of the virtual directory and I'm receiving the following error: "Could not...
    3. HELP! Can't find path to text file
      Hi Everybody, Someone PLEASE help me figure this one out! I am using a Flash template that someone else designed. The movie I'm working on only...
    4. "Could not find a part of the path… " error on IIS 6.0
      I have an ASP.NET web application running on a load-balanced Windows Server 2003 web farm running IIS 6.0, using Active Directory authentication. ...
    5. Err Msg : Cannot find file '%path%'. Please make sure.....
      I recently installed Trend Micro Office Scan on my PC at work and found out my computer was infected with tree viruses. I do not have the virus...
  3. #2

    Default Re: Could not find path error

    the problem is probably permission. unless your asp.net account is a domain
    account, it will not be able to access the share. if you must use a local
    account, you will need to set the password, and create a matching local
    account (with the same password) on the share, or use impersonation and fill
    a domain account and password.

    -- bruce (sqlwork.com)


    "Steve" <anonymous@discussions.com> wrote in message
    news:OOMGA3QtEHA.2864@TK2MSFTNGP09.phx.gbl...
    > Hi all,
    > I am referring to this article in MSDN :
    > [url]http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp[/url]
    >
    > While creating folder on the remote machine, we are specifying the UNC
    path
    > as per the example. But we get this error "could not find a part of the
    > path".
    >
    > we are prefixing the path with @ symbol and also tried with the escaping
    the
    > "\\".
    > Path is correct and and all the permissions have been granted. ASP.net
    > application and the remote folder machine are in the same domain. We tried
    > with mapped drive as well , it did't work.
    >
    > We are trying out the sample application you have sent. CreateFolder
    method
    > is invoked from the Default.appx.cs file's Page_load method and remote
    > folder path is passed to the CreateFolder method and it is shown below.
    >
    > CreateFolder(@"\\mypath\shared", "IOFolder");
    > Here mypath is the remote machine and is in the same domain of Web
    > application. "shared" folder is shared for everyone and full access has
    been
    > given to all the users.
    >
    > Below is the code snippet from the CreateFolder Method
    >
    > try
    >
    > {
    >
    > DirectoryInfo dirInfo = new DirectoryInfo(strTragetLocation);
    >
    > Response.Write(dirInfo.Exists);
    >
    > string strFolderToCreate = strTragetLocation + "\\" + strFolder;
    >
    > Directory.CreateDirectory(strFolderToCreate);
    >
    > }
    >
    > catch (Exception ex)
    >
    > {
    >
    > Response.Write(ex.Message);
    >
    > return false;
    >
    > }
    >
    > In the above code DirectoryInfo.Exists method returns false and after
    that
    > it tries to CreateDirectory and it throws the following exception "Could
    not
    > find a part of the path \"\\\\mypath\\shared\."."
    >
    > Any ideas ?
    >
    >
    >
    >

    bruce barker Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139