Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string GetCountryResourcePath(string countryName)
- {
- Assembly assembly = this.GetType().GetTypeInfo().Assembly;
- string[] assemblyResources = assembly.GetManifestResourceNames();
- string searchTerm = string.Format(".{0}, countryName);
- foreach(string resourcePath in assemblyResources)
- {
- if (resourcePath.LastIndexOf(searchTerm, StringComparison.OrdinalIgnoreCase)>0)
- return resourcePath;
- }
- return string.Empty;
- }
- string countryResourcePath = GetCountryResourcePath( countryName );
- if (countryResourcePath == String.Empty)
- return;
- using (Stream countryStream = assembly.GetManifestResourceStream(countryStream))
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement