This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected virtual bool IsFileLocked(FileInfo file) | |
{ | |
FileStream stream = null; | |
try | |
{ | |
stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); | |
} | |
catch (IOException) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetworkConnection : IDisposable | |
{ | |
string _networkName; | |
public NetworkConnection(string networkName, | |
NetworkCredential credentials) | |
{ | |
_networkName = networkName; | |
var netResource = new NetResource() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls | rename-item -newname { [io.path]::ChangeExtension($_.name, "c") } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip list | Select-String -Pattern '(\w+) \(.*\)' | foreach {pip uninstall $_.Matches.Groups[1].Value} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var i in Enumerable.Range(0, 10)) { | |
Console.WriteLine(i); | |
} |
NewerOlder