Sunday, April 17, 2011

File Path check

Hi

I wanted to chek file existance with UNC path.

But i thought UNC will slow for cheking of file.exist method.

so i want to map that UNC path and then check for the File Existance case..

how can i map drive using C# code..

and any one have exact idea about timing to check File Existance with UNC path & Map drive path..

as in my testing i found UNC is faster to check file existance compare to map drive..but wondering how it possible?

Thanks

From stackoverflow
  • Use the MapNetworkDrive method.

    First add a reference to the "Windows Script Host Object Model" on the "Add reference" COM tab.

  • The speed deficiency really shouldn't have to do with using UNC paths over "regular" paths, but rather that you're accessing remote data. In other words, it's the network latency, session management and permissions checking that costs time, not string parsing.

    Additionally, mapping (and unmapping) operations cost some time.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.