|
maybe create your own propertiary binary fileformat to store the data in, obfuscate the data in the binary file, throw in som red herrings.
If you have time and resources, maybe create your own file system format (Maybe take a look at the FUSE API?), that windows isn't able to read from, and format the usb sticks to that format, have an implementation of a "yourWackyFS"-reader in your app, this probably means that you need to write a dll to access the files on your filesystem in ASM (to get the low level Red/write access you need), or a dll writen in c/c++ whit alot of inline ASM and p/invoke the dll into your C# application .
Maybe encrypt the important data in the file, and not the whole file, and decypt only the data you need when you need it?
An another posibilty is at setup of your application, create a virtuel disk on the users computer, that is not visible for the user and only accessable by the proper processes, and save the file to that virtual disk. (Maybe take a look at this product: http://www.eldos.com/solfs)
modified on Wednesday, August 19, 2009 6:52 AM
|
|
|
|
|
Case is we have ArcGIS shape and grid file... We are using map window OCX control to load and show the shape file... OCX controls wants the physical file path of the shape file to open it... I cannot change the format of the file because it is ESRI standard format... We want to protect these shape files from being copied, getting deleted...
Creating virtual disk is not possible in C#
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Isn't ArcGIS shape just a renamed zip-file containing a dbase database and some text files with meta data?
maybe it is posible to create your own format, and recreate the zip/shape file in-memory using sharpziplib and stream the in-memory shape file to the OCX control? and then you can encrypt key data in the binary file.
"Creating virtual disk is not possible in C#" - yes it is, it's just a matther of what dll's you p/invoke, and ...huhum...
C:\Program Files\EldoS\SolFS\dotNET\Managed, or if eldos isn't your thing, maybe This is?
modified on Wednesday, August 19, 2009 9:52 AM
|
|
|
|
|
thanks for reply...
I am using map window ocx control whose API requires fullpath of shape file to passed as paramter to be loaded.. I can't pass stream to it.
Can you help me by giving the link of source code about how to create virtual drive in C#
Is there any alternate way to handle it....
thanks again
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Here is what you are looking for Eterlogic virtual Drive SDK
Quote:
"Virtual Drive SDK allows you to create and manage virtual disks that appear in Windows as regular disks. Virtual disk can be located anywhere: on hard disk, network, random access memory, database etc. To do this on your own you need to develop a driver that requires deep knowledge of operating system internals, and a lot of time for debugging and testing it. Virtual Drive SDK makes possible to implement read/write operations without having to develop your own kernel driver. All necessary part of boring work is done, so you can focus on storage, encryption etc. "
Quote:
" * Simultaneous work with up to 8 virtual disks
* Simple user mode API for kernel driver management
* User application freeze/crash detection
* Automatic removal of dead volumes
* Read-only volumes support
* Built-in formatting support
* Samples for C++, C#, Delphi, Python
* Special distribution mode (does not require separate SDK installation)"
|
|
|
|
|
Hello everyone.
I'm googling a lot of sites but none gives me a near answer to my requirements.
I'm am about to work on a project which requires me to use excel sheet to handle the inputs and computation... and later all values inputed and computed will be stored in a database....
below are the steps...
1. store or embed an excel file as one(1) record in a database. Every record has different computations and inputs... in short, embeded excel sheet will serve as templates for future data entry
2. Data entry proper.
a. embeded excel sheet will display only the columns "A and B".
hidding the rest of colums which has the formulas in it.
b. upon losing the focus, columns "A and B" will be computed
based on the formulas from the hidden columns.
c. Save the updated template in another table as new record.
d. Read the inputed and computed values from embeded excel,
then store it in a table as new record.
Hope some can guide or can give me a sample of the above requirement... Thank you in advance...
xxx
|
|
|
|
|
|
thank you for your emmediate reply... how can i display only columns A and B... hidding the rest of the columns?
xxx
|
|
|
|
|
Hi guys,
does anyone know how to underline just one word within a lable?
|
|
|
|
|
You'd need to create your own control to do that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Subclass System.Windows.Forms.Label control and override OnPaint method. Use the graphics object and work with DrawString()[^] method.
|
|
|
|
|
|
i don't suppose you know of any good tutorials on this?
|
|
|
|
|
Until now i used a "List<student>" to going over a lot of students (not from DB) and i want to keep to best 10 student (maybe later i will want to save 10,000 and more) .
I used to list<student> and every time im insert a student and then sort the list. After the sorting im checking if there is more then 10 student and then take out the lower grade in the list.
The problem is that every iteration im sorting the list that is allready sorted because there is one new stduent that been insert to the list.
Is there ant other way to do it?
(i tryed to use SortList and you can see the problem , the key is the grade and it's possible that 2 student will have the same grade).
What is the best option?
If i have SortList and i want to save 10 object with the best result how can i do it?
For example if i have a student class and the comparison function between 2 stduent is by grade how can i save a list with the best 10 stduent?
(if 2 stduent have the same grade i have a problem with the key).
class Student : IComparable
{
public int id;
public int grade;
public string studentName;
public int CompareTo(object obj)
{
Student std = (Student)obj;
return std.grade - this.grade;
}
}
public SortedList GetTheBest10Student()
{
SortedList sortList = new SortedList();
for (int i = 0; i < StudentNumber; i++)
{
Student std = GetThisStudent(i);
sortList.Add(i, std);
if (sortList.Count > 10)
sortList.RemoveAt(10);
}
return sortList;
}
Thanks and regards,
Shai, Bonzai.
modified on Wednesday, August 19, 2009 5:12 AM
|
|
|
|
|
bonzaiholding wrote: The problem is that every iteration im sorting the list that is allready sorted because there is one new stduent that been insert to the list.
You need insertion sort and don't sort the whole list for each insertion. When adding an item, compare with all the items in the list and find a suitable position for that new item. Complexity of this will be O(n).
bonzaiholding wrote: (i tryed to use SortList and you can see the problem , the key is the grade and it's possible that 2 student will have the same grade).
What is the best option?
I don't see any problem here.
bonzaiholding wrote: If i have SortList and i want to save 10 object with the best result how can i do it?
Take the last or first 10 elements from the list depending on your sort order.
|
|
|
|
|
Thanks.
I tryed some other methods but in the end i just use this function :
private void InsertThisStudent(Student std, List<Student> List)
{
for (int i = 0; i < List.Count; i++)
{
if (std.CompareTo(List[i]) < 0)
{
List.Insert(i, std);
return;
}
}
List.Add(std);
}
thanks
|
|
|
|
|
Hi,
I have developed an application in C# i have done the GUI interaction.
But i want to invoke the API's through CMD.Please gaide me how to do C# application through command line.
With Regards
Mahesh
|
|
|
|
|
maheesh wrote: But i want to invoke the API's through CMD
Invoke APIs? Do you want to start the application through command line? If yes, go to the application directory and type your executable name. If you need to pass additional parameters to the program, pass it after the executable name. Something like
yourexename.exe arg1 arg2 arg3
You can read these in the program's main method.
|
|
|
|
|
I need to pass the parametes like
1.Input file name and path selection
2.Output Folder path selection
Not to invoke the form application,i have genarated class library file of my application.
I want to invoke the dll through cmd
Please help me
With Regards
Mahesh
|
|
|
|
|
Do you mean that you want to call methods in your (GUI) application via Command line arguments?
In that case, just handle the arguments in your application's Main method before the Application.Run(...) call is made.
|
|
|
|
|
Not GUI application.
The main functionality of my application i made as class library.
I want to provide inputs to class Library through CMD.
GUI part i have done.
with Regards
Mahesh
|
|
|
|
|
Okay, then create a Console Application and add the DLL assembly as a reference and make calls to the methods in your DLL by passing on the command line arguments from the Main method.
|
|
|
|
|
Ive created a custom control which fires event, and it works fine when I drag the control onto a form, and In that form I can create the event handler.
But now im dynamically loading the control into the form during runtime(Assembly.LoadFrom etc.). So obviously below that creating code when I try say userCtrl.myEvent += new EventHandler(this.myHandler); it wont work.
I understand why it doesnt work, I just have no clue what to do.
Thanks
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
Why are you using Assembly.LoadFrom ? You can add control dynamically like this:
YourUserControlClass userCtrl = new YourUserControlClass();
userCtrl.myEvent += new EventHandler(this.myHandler);
this.Controls.Add(userCtrl);
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
By dynamically I mean totally dynamically. Like they browse and select a dll. So its not included in the solution before runtime.
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|