|
I'm Aware of this fact, and I'm currently working on solutions to it
By hardware dongle do you mean memory stick?
One of the solutions im looking at is creating the file with installation, then using a If statement to see if the file exists or not, if it does, then it writes to the file, if the file doesnt exist then the application will exit.
True all the user would have to do then is make another file. But it should stop casual snoopers, All I really want it for is to make sure my friend doesnt leg it with a BETA release of some of my software, nothing too big.
thanks All,
Ben.
|
|
|
|
|
Ben Magee wrote: By hardware dongle do you mean memory stick?
not necessarily. There are products (such as WIBU Codemeter) that use a special hardware device (nowadays usually USB) to protect your app, which gets modified obviously, in a way that is supposed to be not so easy to hack; the variable cost would be around 30 euro.
for cheap software, it is possible to do it yourself e.g. based on a memory stick, as they AFAIK always contain a rather unique ID (from observation, and not guaranteed).
both methods require the hardware to be present for the app to run, which is both a hard-to-copy way of protecting, AND a burden for the user. However it is much better IMO than relying on some built-in unique ID (baseboard serial number, disk serial number, MAC address, ...) as these are not always present, some can be changed easily, and users don't want licensing trouble when changing some hardware.
|
|
|
|
|
Luc Pattyn wrote: you are well aware is not the way to implement trial limitations. real solutions would use access to a web server, or a hardware dongle
Whilst this is true in almost all situations, the OPs method might be enough, depending on the location of the "oote.oost" file, the permissions for that location and the knowledge/skill level of the users.
As I do not do commercial development I do not feel that I have the depth of knowledge to advise people on these matters. I restrict myself to trying to answer their questions. There are always people with working knowledge of such techniques that can advise the OP, if they feel it necessary.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi All,
I have custmized grid which is inherited from windows datagrid(1.0).
In this i need to implement : Shift-clicks in either list area should be supported to select all rows between the current row being selected and the last row selected.
In this grid i also have to allow user for Multiselection of rows and scroll on the data grid using Arrow Keys.
I could not implement Shift Click functionlaity.
Can any one help me how to implement "Shift-clicks in either list area should be supported to select all rows between the current row being selected and the last row selected" functionality ?
|
|
|
|
|
Hi, I was wondering if someone could give me some feedback on this method.
My goal is to join several files into one and it works but is this an effective way of doing it?
Is there something I can do to speed it up and make it more effective?
I have tried playing with the buffer-size and increasing it makes it faster up to a certain point.
private void JoinFiles(string[] files, string outputFileName)
{
int buffSize = 1024;
byte[] buffer = new byte[buffSize];
FileStream fsSave = new FileStream(outputFileName, FileMode.CreateNew);
foreach (string file in files)
{
FileStream fs = new FileStream(file, FileMode.Open);
long fileSize = fs.Length;
while (fs.Position < fileSize)
{
if (fileSize - fs.Position > buffSize)
{
if (buffer.Length < buffSize)
buffer = new byte[buffSize];
fs.Read(buffer, 0, buffSize);
}
else
{
buffer = new byte[fileSize - fs.Position];
fs.Read(buffer, 0, (int) (fileSize - fs.Position));
}
fsSave.Write(buffer, 0, buffer.Length);
}
fs.Close();
}
fsSave.Close();
}
|
|
|
|
|
Hi Johan, I think without using Win32 to read/write the files at a lower level, what you've come up with is the best that .net can offer. The method below works in exactly the same way with a couple of minor changes for memory efficiency & some personal preferences - there's no need to create a new byte[] on each loop; just use the same buffer that you define at the top. I usually use a buffer size of 4KB as a balance between memory usage & file access operations. There's no need to calculate the buffer size to ensure you don't read past the end of the file - .Read returns the number of bytes actually read, even if you asked for more than is available. Finally, a personal preference, I like to use using() blocks with the FileStream just to guarantee the file is closed (the Dispose method on Stream is actually hidden, but it is there & calls close).
Hope this helps, Rob
private void JoinFiles(string[] files, string outputFileName)
{
byte[] buffer = new byte[0x1000];
using (FileStream fsSave = new FileStream(outputFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None))
{
foreach (string file in files)
{
using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
{
while (true)
{
int count = fs.Read(buffer, 0, buffer.Length);
if (count <= 0) break;
fsSave.Write(buffer, 0, count);
}
}
}
}
}
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
great. less code, a single buffer, my 5.
|
|
|
|
|
Thanks a lot for you answer, it's a much better looking code and it's easier to read.
I just love getting feedback and watching how others write their code, there's a lot you can learn from that.
So thank you again...
|
|
|
|
|
I want as the installer runs, it pauses and asks for the serial key to continue installing. Just as Windows XP or Office does. I understand that this might not be related to C Sharp coding exactly but i did my software with C Sharp! I am using Visual Studio 2005. How can one configure the installer to do that?
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
You can look at this [^]article at MSDN for validating the serial key.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I've created a Groupbox, there is a textbox in subset of it.
I've changed Groupbox's RightToLeft property to Yes, But I wanna change it for textbox to NO.
I couldn't do it , because textbox is in subset of Groupbox.
Could you please guide me , how I can change it ?
Thanks.
|
|
|
|
|
Your question is not exactly clear, but I am taking it to mean that you have created a Control which inherits from GroupBox and this control contains a TextBox .
You can set the property in design view of your control but if you want to be able to do it once your control is placed on a Form (for example), you need to surface any properties of child controls in your control. Something like this:
[Category("Appearance")]
public Color CountryTextBoxBackColor
{
get
{
return this.countryTextBox.BackColor;
}
set
{
this.countryTextBox.BackColor = value;
}
}
I have used BackColor in this example because I couldn't remember the Type for RightToLeft but the principle is exactly the same. You will need to do the same for any properties of child controls that you need to be available at design time.
The code above should be part of the code for your control, in case you have not worked that out.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I will give an exmaple. We have a list box and a text box. On click of a button the text box will get enabled and the text enterd in the text box will be displayed in the label on another button click. This data is not saved. Now when i close the application and run again the labels are empty. How to store the entered data and display it in label.
Thanks,
Santa
|
|
|
|
|
There are quite a few ways you can do this. What have you learnt on your course so far, that might be applicable? What have you tried?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Please tell me how to do it. The example which i have given above in the thread is what i have tried. But when we close the applicationa dn run it again i do not get the same names in the labels.
|
|
|
|
|
I'm not going to give you the solution to your homework!
You will have to think about it a bit, but I'll give you a few clues:
System.IO.File is one way.
System.Configuration is another.
There are (probably) a dozen or so ways this could be done. Have a look at Google, and try something. When you have a specific problem (other than "I can't do my homework") post some details of where you are stuck.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Information displayed in Windows (forms) is placed there by the application that owns the forms. Information entered by the user must be saved somewhere by the application if it is needed again. You must decide how and where to save it so that it is available next time you run the appication.
|
|
|
|
|
I am working on Web application. And i do not want to store the data in DB and bring it back from ther. IS there any other possible ways to do it.
TIA.
Thanks,
Santa.
|
|
|
|
|
Storing it in a DataBase may be the best option; it all depends on how your application works. As I said before you must decide where is the best place to store this information. See earlier suggestions, also consider a flat file, the Registry etc.
|
|
|
|
|
For a web app, the user may run it from any computer so storing stuff locally is unlikely to be what you want, a DB on the server is a good idea.
|
|
|
|
|
how execute exe files in C#.net?
|
|
|
|
|
Use using System.Diagnostics NameSpace.
Then use Process Class to Execute an Exe.
eg:
Process.Start("IExplore.exe")
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
If you need to pass some arguments to the exe file, here is an example
Process p = new Process();
ProcessStartInfo ps = new ProcessStartInfo();
p.StartInfo = ps;
ps.FileName = "file.exe";
ps.Arguments = "Some commandline arguments";
p.Start();
|
|
|
|
|
|
It seems you have joined code project Today . So welcome to CodeProject.
Mishra Aditi wrote: hi how r u???????
Please Don't SPAM.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|