/*
The resource file stores items as name-value pair.
To get string values from the resource files (.resx) added in your project, use the following code.
*/
//Name Spaces Required
using System.Resources;
using System.Reflection;
// Create the resource manager.
Assembly assembly = this.GetType().Assembly;
//ResFile.Strings -> <Namespace>.<ResourceFileName i.e. Strings.resx>
resman = new ResourceManager("StringResources.Strings", assembly);
// Load the value of string value for Client
strClientName = resman.GetString("Client");
Tag Archive for csharp
CSharp Reading String from Resource File .
Regular Expression to Grab an Object Type Name from a C# Code File.
(?<=news)s*S*?s*(?=[[(])
Regular Expression to Grab an Object Reference Name from a C# Code File.
S*s*(?==s*S*s*news)
Regular Expression to Grab a ClassName from a C# Code File
(?<=classs)s*S*
Python – getFile Internet
package get.file.example;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class GetFileExample
{
public GetFileExample()
{
try
{
byte[] bite = new byte[2048];
int read;
URL url = new URL("http://switch.dl.sourceforge.net/sourceforge/pys60miniapps/FlickrS60_src_v0.1b.tar.bz2");
BufferedInputStream bis = new BufferedInputStream(url.openStream());
FileOutputStream fos = new FileOutputStream("/tmp/file.tar.bz2");
while((read = bis.read(bite))>0)
{
fos.write(bite, 0, read);
System.out.println("--");
}
fos.close();
bis.close();
System.out.println("FINE");
}
catch(MalformedURLException e)
{
e.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
new GetFileExample();
}
}