Absolutely on both counts! Using resource files with business objects can be accomplished in two ways: compile the resource files along with the business object, or leave them as separate .resources files. In the latter case, you can use them exactly as you have done today. In the former case, you'll have to change your code slightly. The CreateFileBasedResourceManager method won't work when the resource files are compiled. Instead, you have to specify the assembly that contains the compiled resource files, with the following ResourceManager constructor: dim objRM as New ResourceManager("prefix", System.Reflection. _ Assembly.GetExecutingAssembly(), Nothing) The first and third parameters are the same as for the CreateFileBasedResourceManager method. The second parameter, System.Reflection.Assembly.GetExecutingAssembly, returns an Assembly object that represents the assembly that the code is executing from. ASP.NET then knows where to look for the resource files, and you can retrieve values from them the same way as before. Resource files can be compiled the same way as VB.NET or C# files, with the vbc.exe or csc.exe program. Compiled files that contain only resource files are known as satellite assemblies. Refer to the .NET Framework SDK documentation for more information, or check out Sams Teach Yourself .NET Windows Forms in 21 Days for information on localizing non-Web applications. |