USB Memory Stick hidden partition [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am writing a kind of accounting software which will run portable on a USB Memory Stick. I would like to make a hidden partition on the Stick to store some data to check the validity of the database file on the main partition. Currently I don't know how to start. Could anyone tell me any way to do it? What partition type should I use? How do I read from it with C# .NET? What Win32 APIs are there. Anything.
UPDATE:
Here's a scenario, I use a file (encrypted) to store a value (e.g. Amount of money), the user can backup that file, and whenever he restore the file, he restore the value at the time he backup. That's why I want to have a hidden partition. Encryption is not an option for me.

Rather than hiding you can use encryption
How to lock a folder on a USB drive?

There is a TrueCrypt project that does something similar you want. It is open source, so you might take a look how they are doing that.

Related

C# make file readonly [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I created an Outlook add-in that checks if some forbiden words are present in an email before it is sent. It simply compares a string containing the email with words present in a .CSV file.
I don't mind people being able to read that .CSV file, but I do not want them to be able to modify it, except if they are doing it using the Outlook add-in.
To do this, I wanted to change the properties of the file depending on the user. When using the addin, the admin user would get the Read/Write rights, whereas the otherones would only be able to read it. However, outside of the add-in, I want that file to be readonly for everyone.
I tried using File.SetAttributes("myPath", FileAttributes.ReadOnly); but then the user can simply go in the file properties, uncheck the "Readonly" option, and he can do whatever he wants ... Can I avoid this ? Is there a smarter option than the Readonly mod ?
You can encrypt the stored file.
To perform any operations, application can decrypt it in memory. User will not be able to modify unless using the application. Forced user modification will corrupt the file and make it unusable.

Is System.File.IO.Copy atomic (another process can access/read during copy)? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I've looked into the documentation https://msdn.microsoft.com/en-us/library/9706cfs5(v=vs.110).aspx , but I cannot find anything on wether the operation is atomic or not? Atomic in the sense that another file can access/read the file while copying.
I do not think "atomic" is right wording for your question unless you're talking about copy as part of an atomic transaction (which AFAIK can't be done in .NET without P/Invoke CopyFileTransacted).
Well...that said...this in an implementation detail and given that .NET runs on different platforms then it may also be different in each one.
File.Copy() historically on Windows desktop implementation simply invokes Win32 CopyFile. Its behavior in this regard is...undocumented but we can inspect how handle is opened. From a quick test you can see that:
Source file is open with FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE.
Target file is open with FILE_SHARE_READ, FILE_SHARE_WRITE.
Safe assumption: do not assume anything, OS, media and file systems may have different rules. Also do not assume that this is stable over time.
Educate reasonable assumption: you may assume that source file has FILE_SHARE_READ and assume nothing about target file.

Best local database for WPF Applications [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Referring to this question that's already been answer:
"What is the best local-database solution for WPF applications?"
What is currently my best choice of local database for my program? Currently I am using XML that is automatically created on the computer when the user run my executable for the first time or when the XML is missing.
I am perfectly fine on using XMLs, users of my application would not be required to install any software other than my application and I can do exactly with it, but my problem is with searching.
My application includes a database (the XML) of all their songs in their music library, and of course each track has its own information and search through each track is really slow! since it's a music library, one user can have at least 1000 tracks or more and searching through it is really really terrible.
I am familiar on using SQL database, (i don't know the proper term for it) but one for online database, I use XAMPP and read the database on a website on PHP. And i really like it. So..
Basically, I am looking for a good local-database solution, where user's won't to download and install any other software (but I am okay, if i would have to include a certain dll to my exe in other to run), and also one that is lightweight and fast in terms of searching.
Yes, i've read the included related question as many times as i could for me to understand it myself but i hope someone can explain the advantages and disad of each of them.
No, i am not looking for one that needs to have a server or something in order for it to work
Previous suggestion is correct SQLite will be your best option because WPF operates .NET Framework. It also supports ODBC driver as i recall
I was going to just comment but can't quite yet.
I wouldn't say there's necessarily a 'best' in most cases. In general whatever you go with is unlikely to be that bad of a choice..
Having said that, I could suggest SQLite as an option for you. Lightweight, very fast, certainly good for strictly local-database options.

Gain administrator privileges in Windows Embedded Standard 7 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Am asking on how to gain administrator privileges in Windows Embedded Standard 7, i have an embedded machine that works with WES7 and i can't access some of the developers needed peripherals in order to perform some developing stuff like : RS323 Port, even more i can't modify some system files in order to control the startup applications or control the kernel, eventually i can't remove some files like : pictures or txt files that i've created before, but i have done this through command prompt, just to remember, am working in C#.
Here i can't access COM port when i try to send data through it :
I have founded the solution : i've stopped the process "Server.exe" in the directory : "c:/data " that have been taking the COM port to control the machine over wifi, and now i can have the full access to the COM port, another thing, i can now modify the system simply by unlocking the hard drive by typing in CMD the command : "fbwfmgr /disable".
+1 Please if it helped :)

looking for how to transfer file to 200 terminals (windows-mobile) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
i have 200 terminals (Windows-mobile) that connect to the server Through WIFI
how i can transfer any file to all of them ?
is there any tool or can i get any C# sample code for this ?
thanks in advance
You should write some sw on the mobiles to sink the file instead of pushing on them. So each user can ask the server for transfer the file. If the file you need to transfer is a deploy of an application, you can even consider some strategy of auto upgrade as described here: http://msdn.microsoft.com/en-us/library/aa446487.aspx
You could create a log-on script assuming you have Active Directory and a friendly system administrator.
http://www.rlmueller.net/LogonScriptFAQ.htm
Microsoft have a non-free tool called System Center Configuration Manager that will do what you want. You need to install the client app on the phones first, then they poll the server for updates.
This is likely to be massive overkill for what you want but it's hard to be sure from the question.

Categories

Resources