|
It's not an encryption, but an encoding. Below example should work, tested it with the Polish Army Oath from the Wikipedia;
public static void Main (string[] args)
{
Encoding enc = Encoding.GetEncoding("iso-8859-2");
string someString = File.ReadAllText("test.txt", enc);
Console.WriteLine (someString);
}
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, but I know this type of encoding. I just don't know how to use it with binaryreader that I need to use.
|
|
|
|
|
Why do you "need" to read it as binary and convert it to string, when you can read it as a string?
There's an example[^] on MSDN that shows how to use the encoding with a array of bytes.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello
I need to have a ressource folder automaticaly created into the bin folder by the compiler and automaticaly copy a text file in it
Purpose :
My application need to read some information into a predefined textfile
I can obviously create that text file into the ressouce folder of the project
But when I compile the project I need that this text file will be automaticaly copied into the ressouce folder in the Bin Folder
What is the method to do that ?
Thanks a lot for your help
|
|
|
|
|
baranils wrote: What is the method to do that ?
You could include the file and go to the properties page and select "Always copy", or create a batch-file and execute that prior to build. Remember that the IDE can execute commands before build, is somewhere in the projects' settings.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thank You !
"Always copy" is the tip !!
|
|
|
|
|
in some IDE's (such as Visual Studio) you can specify pre-build and post-build commands; these get executed at the start and termination of a build, and use a DOS-like syntax. Copying some files in this way is a typical usage.
OTOH if your files are present while building, what makes you think they will disappear? You can add all kinds of files to a project, and get them deployed. Again, VS gives you a choice of actions to be taken for files it doesn't normally know about, the choices are: none, compile, content, embedded resource. I suggest you experiment a little.
|
|
|
|
|
I'm developing a c# desktop application that manage Facebook ads ( create , send , delete ...).
I cant find a way to manipulate Facebook api related to ads .
I will be grateful for your help .
thanks .
|
|
|
|
|
twotwins wrote: I cant find a way to manipulate Facebook api related to ads .
Luckily, Facebook provides documentation[^].
Enjoy the read
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
there are nothing there useful I'm searching how to manipulate the fb ads api with c# and thanks for trying to help me .
|
|
|
|
|
twotwins wrote: there are nothing there useful
It descibes how to use the FB ads api.
twotwins wrote: I'm searching how to manipulate the fb ads api with c#
The documentation is language-agnostic. If you need a third-party wrapper that talks from C# to FB on your behalf, have a look at the Facebook SDK[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi Everyone,
I want to create an Application for Image Cup. In Which the requirement is that we can change the Image Cover from application.
So Please help me where from i can start.
Thanks
If you can think then I Can.
|
|
|
|
|
What is an image cup and what is an image cover? The question needs a lot more definition.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You already asked this question yesterday in QA.
Asking it again is not going to change the questions, nor the answers you get. You simply haven't provided enough detail about EXACTLY what you are doing and how you are doing it for anyone to help with any accuracy.
|
|
|
|
|
As a part of my project i need c# code for compairing two finger print images. I already had some finger prints. so I need help to check whether the two finger prints matching. No need of fingerprint scanner.
please help me..
Thanks in advance.
|
|
|
|
|
i understand what you are asking about, so i think the answer is number 2 from this link.
interesting project, best luck.
|
|
|
|
|
having followed Midnights link do you have a more detailed question to ask or are you just here to ask for the code.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I am sending data from mobile app to REST in binary format like this:
"firstname=Mike&lastname=Smith&..binary represenation for the image here.."
class Employee{
string firstname;
string lastname;
Stream photo;
}
public string PostMethod(Stream streamObj)
{
using (FileStream filetoUpload = new FileStream(filePath + filename, FileMode.Create))
{
byte[] byteArray = new byte[10000];
int bytesRead = 0;
do
{
bytesRead = streamObj.Read(byteArray, 0, byteArray.Length);
if (bytesRead > 0)
{
filetoUpload.Write(byteArray, 0, bytesRead);
}
}
while (bytesRead > 0);
}
return "Uploaded " + filePath + filename;
}
I do know how to get the contents of the Stream into a byte array. What do I need to do to be able to read the bytes from the StreamObj into the class? Some pseudo code would be helpful.
employee.firstname = ...
employee.lastname=...
employee.photo=....
modified 3-Jul-12 0:09am.
|
|
|
|
|
First you need to split your array into sections as delineated by the & character. You can then convert the first two to properly encoded character strings using the System.Text.Encoding.GetChars() [^] method, and then split them based on the = character.
|
|
|
|
|
Might not work - I think he needs to look a little more closely at his data. The third section is raw binary by my interpretation, so it probably shouldn't be in a string at all or he runs the risk of unicode conversion problems.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
My suggestions were largely guesswork, but I wasn't proposing to convert section 3 to a string, just the first two.
|
|
|
|
|
Software2007 wrote: I do know how to get the contents of the Stream into a byte array.
Google for Serialize/deserialize - takes only a few lines of code. You'll be wanting the BinaryFormatter .
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
OriginalGriff is correct that the image section is raw binary. So, what to do again?
|
|
|
|