|
|
Would I be able to read profile data, notes, etc using this API?
|
|
|
|
|
Stop asking and RTFM !!!
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What is a RTFM, can you post some sample codz plz
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Apparently this[^]
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
System.Diagnostics.Process.Start("C:\\Program Files (x86)\\Combined Community Codec Pack\\MPC\\mpc-hc.exe","C:\\Users\\xxx\\Documents\\Visual Studio 2008\\Projects\\aa\\aa\\bin\\last.mpcpl");
I get MPC-HC Opened, but in playlist i see: VISUAL and STUDIO.
Right click on VISUAL i get C:\\Users\\xxx\\Documents\\Visual, right click on STUDIO i get STUDIO. So something is wrong with passing argument. Probably he read it without " ".
I tried a lot of things, got any idea?
modified on Tuesday, March 23, 2010 2:10 PM
|
|
|
|
|
Have you tried putting the argument in literal quotes?
"\"C:\\Users\\xxx\\Documents\\Visual Studio 2008\\Projects\\etc etc etc\""
If that doesn't work, you can try converting it to the short path name (ex. "C:\Progra~1\")... Found a link with some code for that here[^]. Try adding the quotes first though.
|
|
|
|
|
I tried "\ \", without success. Only success is that i dont get VISUAL STUDIO in playlist of mpc-hc.
The ShortPath is nice, but its a bit too much right now for me. I just dont get why double quoting don't work. There must be a way because i dont belive people avoid using this.
In last point i can just place file in C:/Windows/Temp but I would like to solve this one :/
|
|
|
|
|
No, not like that...
Inside the string, use \" to signify an actual quote character. If you use a double-backslash, you're just sending a literal backslash.
For example:
"\"C:\\Long Path\\File\"" will actually become: "C:\Long Path\File"
|
|
|
|
|
Sorry but i dont understand the one with /", could you bring example ?
And I see it can be related with mpc? because typing in command line "c:/fullpatch/mpc-hc.exe" "c:/fullother path/last.mpcpl" dont work - mpc popup but wont load playlist.
Working on this.
Edited: \" work with video file. so its problem with mpcpl - native? mpc-hc playlist - which failed. It works great (mpcpl) when both are in same folder.
Edited2: I will pass with mpcpl file... to bad... Just for info. You can pass movie after movie after movie and mpc make playlist from in temporery.
modified on Tuesday, March 23, 2010 4:22 PM
|
|
|
|
|
Then yeah, it's a problem with MPCPL. Go with the second solution, translating everything to the 8.3 filenames... It's really just a short code snippet, so shouldn't be too difficult to patch in.
|
|
|
|
|
Hi,
it is a real pain, but in complex situations Windows seems to require each folder level with spaces to be put in its own pair of double quotes, hence:
C:\Program Files (x86)\Combined Community Codec Pack\MPC\mpc-hc.exe
should be passed as
C:\"Program Files (x86)"\"Combined Community Codec Pack"\MPC\mpc-hc.exe
and of course for string literals, you have to escape all backslashes and double quotes by adding backslashes.
|
|
|
|
|
Luc Pattyn wrote: it is a real pain, but in complex situations Windows seems to require each folder level with spaces to be put in its own pair of double quotes, hence:
I have never had that happen. I've always just had to put quotes around the full path to the .EXE and any command lines args that had spaces in them.
|
|
|
|
|
I got that information as a tip years ago, and it did solve a problem where more than one path on the command line contained multiple folder names with spaces. I've never seen any official document on the matter; my library that implements this has "Ask Dr. GUI #54" in its comments, not a real URL. And when I throw that at Google, it fails to come up with anything except for a chinese MSDN page.
Here is the method:
public static string QuoteSpaces(string f) {
env.log(env.TRACE,"quoted in: "+f);
if (f.IndexOf(' ')>=0) {
string[] fa=LP_String.Split(f,'\\');
StringBuilder sb=new StringBuilder(100);
for (int i=0; i<fa.Length; i++) {
if (i!=0) sb.Append('\\');
string fi=fa[i];
if (fi.IndexOf(' ')>=0) {
sb.Append('\\');
sb.Append('"');
sb.Append(fi);
sb.Append('"');
} else {
sb.Append(fi);
}
}
f=sb.ToString();
}
env.log(env.TRACE,"quoted out: "+f);
return f;
}
My IDE app seems to use the method when invoking tools such as DUMPBIN and ILDASM. I'm afraid that is all I can tell you on the subject.
|
|
|
|
|
The way you have your command line right now is this:
C:\Program Files (x86)\Combined Community Codec Pack\MPC\mpc-hc.exe C:\Users\xxx\Documents\Visual Studio 2008\Projects\aa\aa\bin\last.mpcpl
You need to add double quotes around both the path to the .EXE and the arguments you're passing it, like this:
"C:\Program Files (x86)\Combined Community Codec Pack\MPC\mpc-hc.exe" "C:\Users\xxx\Documents\Visual Studio 2008\Projects\aa\aa\bin\last.mpcpl"
|
|
|
|
|
Hello good people,
I was wondering if it is possible to append data to an already encrypted file?
I tried a few projects the past few days but always when i append data to the file, the second line and all lines after that contain mangled data.
Using google to find out if it is possible or not did not give me any desirable results, so i wanted to ask in here if someone knows?
Am i trying to do something that is not possible?
Do i need to take a different approach, like first decrypting all data into a temporary file and then re-encrypt the whole lot?
Any advise would be greatly appreciated, after three days of trying i am hoping someone could enlighten me.
|
|
|
|
|
Although it is possible, it would take a considerable amount of effort to append data to an already encrypted file - in effect running the encryption again to get the encrypter to the correct sate for the insert, including removing any padded final block padding before you append your data. The effort is the equivalent of re-writing the encryption routines.
It would be considerably easier and a lot quicker to decrypt, append, and re-encrypt again. Do NOT use a temporary file, use a memory stream instead as this will not be left on the HDD (unless it is paged off to free memory). A temporary files' contents will be left on the HDD even if the temporary file is deleted, until that disk space is re-used by some other application.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Thank you for your swift answer OriginalGriff.
Let's see if i understand this correctly then, i will try and use your suggested method.
However using MemoryStream to decrypt, append and then rewrite the whole data into the same file wouldn't that overwrite that same file?
Using a memory stream to let's say decrypt a big file into memory, let's say 200MB wouldn't that affect system speed?
|
|
|
|
|
Balletje wrote: Using a memory stream to let's say decrypt a big file into memory, let's say 200MB wouldn't that affect system speed?
Yes. It may speed it up...
It's one of "those answers" which depends on too many variables: Does your system cache HDD writes? Does the HDD hardware cache writes, and is it big enough?
Think about it: If the stream stays in memory, it will be faster than writing to HDD (unless the HDD data also stays in memory). If it gets paged out, then it will be at about the same speed as the temporary file solution, except any other activity in the PC will slow down.
For me, the security risk of leaving unencrypted data just lying around is too high - it defeats the purpose of encryption in the first place. I always decrypt to memory - I may have no control over the page table, nor how many fragments of unencrypted data are in memory, but at least I can be as confident as possible that if you turn the power off, it will be a non-trivial task to access the unencrypted data!
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Ahhhh yes how stupid of me.......
I will go and try to construct a method that will decrypt the file into memory, append last data added to the end and re-encrypt the whole deal back.
Still i think i need to go and try to find some good lecture about this matter as i am having a bit of trouble understanding how it works.
Though people's input here has been great and i greatly appreciate it.
Thank you for explaining!
|
|
|
|
|
Does it even matter? You can't hide anything from the user anyway - if your application has the key and the user has the application then the user has the key, QED.
Anyway, in general it shouldn't be possible. AES is a block algorithm, so there will be padding, and you can't remove the padding without decrypting, because the padding is encrypted. Therefore at the very least, you will have to decrypt the last block. For the rest I am not sure, but I think I remember something about mixing the key with the data? If that is what it does then you can't just "run the key stream* X bytes where X is the length of the file" as you might otherwise do, since in order to do that you'd need to have the decrypted data an you don't have it. Unless of course you do have it, but you seem to want to avoid that. (why? it's not like you're keeping a secret from your users anyway, as proven above. decrypting to ram isn't going to make the situation any worse, although it may make the process slower)
* incorrect terminology
note: as always with posts about "hard" subjects, I can't guarantee the correctness of the contents of this post - use at your own risk.
|
|
|
|
|
Well it seems i need to do a lot more reading then, any good suggestions on books or online material that touches this subject?
It's critical to my application to store the data encrypted if possible, only the information supplied by the user should be encrypted in one file.
I would like to thank you both about shedding some light on this topic.
|
|
|
|
|
Btw, if you're just hiding the data from other users, wouldn't it be a lot easier to just use build-in NTFS encryption?
|
|
|
|
|
Well the application stores information about servers, their locations and needed passwords.
That was basically the whole reason why i wanted that file encrypted because *should* it fall in the wrong hands they will at least have some trouble getting the information from it.
But i am quite new to the whole encryption stuff, so i did not really know which way to take.
|
|
|
|
|
I see, well the build-in encryption is transparent so you don't have to do anything special - just set a flag that you want the file to be encrypted. The encryption is linked to the password of the current user, which is not the hardest thing to find out these days, but then that's probably true of the key used by your application as well..
|
|
|
|