Skip to content

Instantly share code, notes, and snippets.

@llytvynenko
Last active August 29, 2015 14:04
Show Gist options
  • Save llytvynenko/edce3939a25a855d72ba to your computer and use it in GitHub Desktop.
Save llytvynenko/edce3939a25a855d72ba to your computer and use it in GitHub Desktop.
public void Main()
{
//Stream class: http://msdn.microsoft.com/en-us/library/system.io.stream(v=vs.110).aspx
using (FileStream config = File.Open("some.config", FileMode.Open))
using (FileStream otherConfig = File.Open("other.config", FileMode.Open))
{
CallLibrary(config, otherConfig);
}
}
public void CallLibrary(Stream config, Stream otherConfig)
{
//Stream reader: http://msdn.microsoft.com/en-us/library/system.io.streamreader(v=vs.110).aspx
using (StreamReader configReader = new StreamReader(config))
using (StreamReader otherConfigReader = new StreamReader(otherConfig))
{
var configContent = configReader.ReadToEnd();
var otherConfigContent = otherConfigReader.ReadToEnd();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment