|
That depends on the client needs. You should check the differences between the express edition and the full version.
Also keep in mind that while the express edition is free, the full version is not. I never agree to install any pirated software to any client, it's not fair and you too could be held liable.
|
|
|
|
|
Im implementing a currency converter into an application of mine. The data i need to read from is stored in the file CurrRates.txt and is comma delimited. I am trying to set it up so that I open the file, read each line and send that line to an array, then read the next line etc, then closes the file.
As I am trying to learn all this ive spent ages looking for what is necessary, and so far all I have determined is that it usese FileStream. Ive spent along time trying to implement it but my knowledge is limited as, like i said, im still learning.
Any help would be appreciated.
|
|
|
|
|
File.ReadAllLines will do what you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Heres what I have so far:
private void importRates()
{
string[] line;
System.IO.FileStream fStream = new FileStream("C:\\UserData\\Rossulator\\CurrRates.txt", FileMode.Open);
while (fStream != null)
{
// add line to array
}
}
I tried File.ReadAllLines and I either didn't understand or didn't put it in the right place...probably both.
|
|
|
|
|
Okay let me rephrase my question cos im not making sense.
I originaly had:
private void importRates()
{
rates[0, 0] = 0.010289;
rates[0, 1] = 97.1907;
rates[1, 0] = 1.07181;
rates[1, 1] = 0.933001;
rates[2, 0] = 1.67566;
// etc to rates[19, 1] = 0.026708;
}
and everything was working fine. I did this so i could learn how to do it, but also to make sure i had the rest of my code working, which i do. The next step is to take all that rates[19, 1] = 0.026708; stuff, and put it into an external file. I want to read in that file, take each line into an array, and use that instead of having a massive list of information which is very difficult to update regularly.
I hope this clears things up a bit.
|
|
|
|
|
System.IO.File.ReadAllLines(filename)
will read an entire file line by line into a string array.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your help, finally got it, even though i ended up using ReadLine();. The only reason i looked around for something else was because intelli-sense wasn't showing it as an option :/. Anyway, thought id post my final code, just cos.
private void importRates(){
string path = Settings.Default.FileName;
if (!File.Exists(path))
{
MessageBox.Show("no file found at " + path);
return;
}
int lineCount = 0;
StreamReader sr = new StreamReader(path);
{
String line;
while ((line = sr.ReadLine()) != null)
{
string[] ToFrom = line.Split(',') ;
rates[lineCount, 0] = double.Parse(ToFrom[0]);
rates[lineCount, 1] = double.Parse(ToFrom[1]);
lineCount++;
}
sr.Close();
}
}
|
|
|
|
|
File.ReadAlllLines is the better option IF you are doing this on the standard framework and not the compact framework, because the compact framework doesn't contain this method.
If you are on the compact framework the above code isn't a good implementation of the StreamReader object, you should use a tryf statement or the simplier method of a using statement to the StreamReader object to finalize after execution.
Below is better (with the using statement) though you might want to check for End of File and other sorts also (which have not been added by me)
private void importRates()
{
string path = Settings.Default.FileName;
if (!File.Exists(path))
{
MessageBox.Show("no file found at " + path);
return;
}
int lineCount = 0;
using (StreamReader sr = new StreamReader(path))
{
String line;
while ((line = sr.ReadLine()) != null)
{
string[] ToFrom = line.Split(',');
rates[lineCount, 0] = double.Parse(ToFrom[0]);
rates[lineCount, 1] = double.Parse(ToFrom[1]);
lineCount++;
}
sr.Close();
}
}
|
|
|
|
|
I am looking for some good quality skins for a Windows Forms project.
The software is going to be a Winforms app that will be used in conjunction with iTunes/iPhone so I would like the GUI to look more polished than a plain vanilla out-of-the box Winforms app.
What in your opinion are the best free skins currently available?
|
|
|
|
|
Your basic problem is that winforms do not support skinning without some library to do it for you.
Does the iPhone even run .NET ? I'd be astounded if it did.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I've seen some demos of running Mono on the iPhone
|
|
|
|
|
originSH wrote: I've seen some demos of running Mono on the iPhone
DevExpress has very good skins. It allows you to create office 2007 style GUI and many more skins. But I think it won't work with MONO as they will be using many P-Invoke calls to change the default look & feel.
|
|
|
|
|
No - This app is not designed to run on the iPhone. The app is designed to run on a PC but it will sync some data with iTunes/iPhone.
I just don't want the app to look like it was written in 2001.
|
|
|
|
|
Member 3919049 wrote: I just don't want the app to look like it was written in 2001.
*cough* W *cough* P *cough* F.
|
|
|
|
|
That's funny. I will probably write the next version of the app in WPF but for now the app is written in Winforms and I would like to get it out to production as soon as possible.
Do you know of a skin that I can use to give it a look to the effect of a scaled down Windows Media Player?
|
|
|
|
|
|
I am currently developing software that I am planning on selling.
I have created a Setup Project in .NET to install the software to a user's computer.
However, I need to implement logic that provides a 30-day free trial. The software should expire after 30 days unless the user purchases a key.
Can someone here give me some guidance on how I can implement this?
|
|
|
|
|
The easiest way is to check the date your file was created, and check if it was 30 days ago. Another way is to write something somewhere that stores the date first run, and check if it was 30 days ago.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not sure if checking the date the file was created will work.
If the validation was based on the file create date then couldn't the user simply uninstall the existing app and then reinstall it?
When you say "write something somewhere that stores the date first run, and check if it was 30 days ago" are you suggesting that I write to the registry or some other file on the user's computer?
|
|
|
|
|
Member 3919049 wrote: If the validation was based on the file create date then couldn't the user simply uninstall the existing app and then reinstall it?
In fact, the file system will use the original date, if the file is in the same location.
Member 3919049 wrote: When you say "write something somewhere that stores the date first run, and check if it was 30 days ago" are you suggesting that I write to the registry or some other file on the user's computer?
Of course, how else could you do a 30 day trial ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian,
What would stop File.SetCreationTime() from changing the date?
|
|
|
|
|
For example without thinking to much:
1. take the expiration date
2. encrypt it with some symmetric encryption
3. store it somewhere for reference (settings file, registry, whatever)
4. on program start get the current date and compare with the encrypted expiration date.
This isn't a bullet-proof solution, since you're using symmetric encryption, and also the .net assembly can be quite easy
analyzed with reflector. But it's a start
|
|
|
|
|
Wouldn't even need be reflected, you could monitor the registry entry access and delete the key, then you're app wouldn't know it has already been ran...
Normally the best solution is from a wrapper application that controls your program, though these are also broken but not as hard as other methods...
One way I do it is to write a file somewhere (deep random path to in application data folder) Then when I want to find that file I just use DirectoryInfo to loop though the parent and sub directories. To see if it is there. This can be broken with reflection too, but other monitor tools can't really pick the ONE file that made it work.
Actually a combination of the answers above would be your best solution (heh) more checks the harder to break
|
|
|
|
|
First off all if you don't use the registry you could use a crc/hash check on the keyfile to know if it was tampered with. However I don't see the catch in the random path (using filemon I can anytime see what file you're using).
|
|
|
|
|
It's simple to go around Sysinternal's filemon / process monitor
For this example if the application is registered write a empty file call "appreg.dat" to the application's run path, then add this code
DirectoryInfo di = new DirectoryInfo(Application.StartupPath);
FileInfo[] rgFiles = di.GetFiles("*.*");
foreach(FileInfo fi in rgFiles)
{
if (fi.Name.ToLower() == "appreg.dat")
{
MessageBox.Show("This is the pro version!",this.Text);
}
}
Run filemon/procmon and see the file IO results. Save the log and clear the contents, delete the file and rerun the test and compare the results....
The thing is you'd have to work backwards on this example to solve it, having only a unregistered copy wouldn't help much as the registered file doesn't ever exist. You can make this much more secure by reading multiple directories and looking for more than one file ect.. This still isn't the best method, though if combined with a few others it can become fairly safe (except for reflection) or decoding the CIL. You'd need Dotfuscator and other tools to make it more safe.
I didn't say this before because it is sort of off-topic. Yet, the fact remains it is impossible to make a trial which contains full functionality DIE and not be brought back to life. The best thing is to make your trial a different program with limited use and then distribute the full version after they pay. Then someone who pays can still leak the real app to the general public, so pick your poison.
|
|
|
|