Create a directory on UNC Path web part sharepoint -


I created a web part that gives a button, on the click of this button, I want to reach the directory of another machine Once in the LAN, when I get access to this directory, I will create nested directories in it with different extension files, but the problem is that when I try to access this folder from the UNC path it gives me an error Giving it as "Path '\ comp01 \ ibc'" Here is the LAN which COMP01 computer name and IBC is a shared folder on that machine.

The following is the code to click on the button,

  void _btnBackup_Click (object) sender, EventArgs e) {try {// UNC path -> \\ IN-Y-SVR2 \ IBC if (string! ISNLLlight (Unpack)) {SPS ite current site = SPCentral.GateConttexSite (this .conttex); SPWeb parentWeb = currentSite.OpenWeb (); String Dior = Path. The name of the gate directory (ankapath); // If the IBC folder is not present, then create it if (! Directory. Axis (DIR) directory.CreateDirectory (dir); Birth Through Children (Parents, UncPath); } And {_lblMessage.Text = "UNC path should not be empty"; }} Hold (Exception Pre) {_lblMessage.Text = ex.Message; }}  

For UNC paths you have to specify it like this:

string path = @ "\\ comp01 \ ibc";

or Avoid String

Try String Path = "\\\\ comp01 \\ ibc"


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -