Convert path C: to C:

Asked

Viewed 140 times

0

I am trying to take the path that is stored in the bank and open by the explorer, and for that I used the code below

path = System.IO.Path.GetDirectoryName(configuracaoBackupAtual.LocalPadraoBackupSqlServer);
                string argument = @"/select, " + path;
                System.Diagnostics.Process.Start("explorer.exe", argument);

But the path to the path is C:\\Program Files\\Microsoft SQL Server\\MSSQL12.SQLEXPRESS2016\\MSSQL

When I publish it did not appear the two backslashes in the name. I believe that’s why it does not open the folder I want.

Another thing I wondered is why @ before taking a path string abc = @"c:\".

  • I don’t quite understand the doubt, and I don’t think you need anything you’re saying there, unless the doubt is something else. It would be interesting to show what you have in configuracaoBackupAtual.LocalPadraoBackupSqlServer. Have the content printed out to see if it’s the way you need it before calling something. You can also use debug. When you find a door in the front, you use the doorknob to open the door, no use pushing it. You can read this: https://answall.com/q/41166/101. If that’s it, it’s a duplicate.

  • @ has to be placed because it is a special character. If you remove it, you have to use " " instead of "". It says more: https://answall.com/questions/41166/o-que-significa-o-sinal-de-arroba-no-c?noredirect=1&lq=1

  • beauty, thanks for the information, I will follow the procedure...

  • But you wouldn’t have to put the @ in "/select" since the select bar is a backslash.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.