UNC路径机器

时间:2018-04-29 23:40:54

标签: c# network-programming unc

此代码以我的项目形式与我合作,但我必须先在网络地图中访问共享服务器的凭证。

我想添加一些带有远程服务器访问凭据的代码,而无需在网络地图中添加用户名和密码,只需添加到我的代码中。

将图像保存在UNC路径机器中

这是我的代码的一部分:

public bool OnPostTransfer(Bitmap bit)
{
    m_ImageCore.IO.LoadImage(bit);

    string fil_name = "new_f.jpg";

    string d_path = "//WIN-KCA4SC9E2U4/Users/hosam/embs/" + fil_name;

    string n_path = pf.check_exist(d_path);
    bit.Save(n_path, System.Drawing.Imaging.ImageFormat.Gif);
    bit.Dispose();

    int x = gv_image.Rows.Count;
    gv_image.Rows.Add();
    Image img = Image.FromFile(n_path);
    gv_image.Rows[x].Cells[3].Value = img;
    gv_image.Rows[x].Cells[4].Value = n_path;
    gv_image.Rows[x].Cells[5].Value = "0";

    //  MessageBox.Show("Image acquired successfully. \r\n");
    return true;
}

注意:远程服务器和我的电脑在网络中的同一工作组中

0 个答案:

没有答案