|
Please do not post complete programs like this; identify your problem and post only the code that is relevant. Members here do not have the time to read through this amount of code.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
"4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can."
That means: "Don't post your entire program: no-one will read it."
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
hello all,
I'm working on an application developped under FOXPRO, the problem is that the deployment procedure is so vulnerable, so that once installed, anyone could copy all its files and past them to another computer and the application will just work fine.
1. would you please advise what it could be done in order to grantee a safe deployment that it can't be duplicated
2. does the suggested process could be developed using C# knowing that the application is developed under FOXPRO
Thank you so much for your usual support
|
|
|
|
|
michael_jhons wrote: 1. would you please advise what it could be done in order to grantee a safe deployment that it can't be duplicated
There's no guarantees, especially not in copy-protection. The only files that can't be copied, are the ones that aren't readable. One option is to encrypt the files, and decrypt them when you need 'em. Another option would be to hide a file on the system, and check for it's existence on start-up. If they forgot to copy the hidden file, you'll know that it's an "illegal" installation.
..but there's no guarantee. It'll be merely harder to copy the data, not impossible.
michael_jhons wrote: 2. does the suggested process could be developed using C# knowing that the application is developed under FOXPRO
Like some kind of wrapper application?
I are Troll
|
|
|
|
|
|
public static string
CircularShift
(
this string Subject
,
int Count
)
{
string result ;
// Left as an exercise...
return ( result ) ;
}
|
|
|
|
|
mnabrisi wrote: any body can help me to find function that can do left Circular shift for any string
Indeed I can. The first step you need to do is to break the problem down into smaller steps. Here, it seems that your logic is - for any string, take the first character off it and put it at the end. Consider your edge cases - what happens if no characters are input? What about if only one character is input?
There you go - you now know what the problem is that you're trying to solve. Good luck.
|
|
|
|
|
|
If you have to do a circular shift on a number why are you faffing about with strings?
There are plenty of examples on the web to do this. Here[^], for example.
There are loads of others though, simply search on c# circularleftshift.
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.”
|
|
|
|
|
Henry Minute wrote: If you have to do a circular shift on a number why are you faffing about with strings?
because h1 and h2 is result from function that return string .
i will see if i can use another function , or convert the return data type .
thx henry .
|
|
|
|
|
Try here[^].
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.”
|
|
|
|
|
Have you looked at this[^] article?
|
|
|
|
|
yes i see that article , the Shift function dose not work with me ,
the encryption in the article is encrypt binary files , but i need to encrypt some text.
|
|
|
|
|
mnabrisi wrote: the encryption in the article is encrypt binary files , but i need to encrypt some text.
What do you think text is? Text is a subset of binary. Anything that works for binary, will work for text...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
i know that .
--
but if you see my code you will know what i meaning .
|
|
|
|
|
If you want it to be as slow as possible, then by all means do math with strings.
|
|
|
|
|
There isn't one. You have to write it yourself.
|
|
|
|
|
AFAIK there is no built in function to do this.
It would be fairly easy to write your own, though.
Assuming an 11 character string. One way would be to reverse the string and then create a new string from the last 10 characters of the original + the last character of the reversed string.
There are loads more ways though.
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.”
|
|
|
|
|
Here's a hint:
str.Substring(shiftAmount) + str.Substring(0, shiftAmount);
Do you really think it would be that hard to implement this yourself?
|
|
|
|
|
it is very good idea
it has never crossed my mind ,it so easy and so small
i do this
public static String CircularShift(string Subject, int Count)
{
int l = Subject.Length;
char[] text = new char[l];
for (int i = 0; i < l; i++)
{
text[i] = Subject[(i + Count) % l];
}
String output = "";
for (int i = 0; i < l; i++)
{
output += text[i];
}
return output;
}
but i will use your idea .
thank you very much.
an thx for every one who trying to help .
modified on Sunday, November 14, 2010 1:36 PM
|
|
|
|
|
please stop using confusing single-character identifiers such as this one:
l
which could be a letter or a digit depending on the font that is used to display it.
BTW: Most letters (such as i and n) are OK, however "L".ToLower() sure is not.
|
|
|
|
|
You're right , really i can't found different between l and 1 in VS2008 it is the same
Usually i used letter such as i j x y
any way thx for your advice 
|
|
|
|
|
That'll blow up if the shiftAmount is out of range. Plus I prefer to allow negative values to specify a shift in the other direction...
shiftAmount %= str.Length ;
if ( shiftAmount < 0 ) shiftAmount += str.Length ;
|
|
|
|
|
That is why it was a hint and not a solution. I generally avoid giving full solutions when the solution is so easy that the OP should be able to figure it out.
|
|
|
|
|