|
thank u very much sir ..........i am student and new i want to learn a lot from here
|
|
|
|
|
Glad to help
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
sir i am devloping a project mysql query browser .....so i will need you in future ....i hope you will be for my help .....if you have facebook account plz tell me i want to conncet wid you...thanx in advance
|
|
|
|
|
A few things.
1. Unless somebody is really stupid and wants to attract a lot of spam, they tend not to give personal information out on the forums, especially to someone they don't know.
2. We are more than happy to help somebody with problems, but nobody on this forum has the time to start offering one to one help.
3. You'll find that we are much more willing to help people if they don't use text speak. It's deeply irritating to those of us who enjoy the full use of the keyboard.
|
|
|
|
|
OK SIR
|
|
|
|
|
sir i want to provide path through " open file dialog box "
...how can i get the path where i want to save my backup file using this dialog box ...plz help thanx in advance .
|
|
|
|
|
Use a FolderBrowserDialog[^].
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
modified 15-Mar-12 2:25am.
|
|
|
|
|
thank you
|
|
|
|
|
Try after adding mysqldump to environment variables (along with the path to it).
|
|
|
|
|
thank u sir ho gya
|
|
|
|
|
altafmohd wrote: ho gya
Just for the benefit of the English community, this means "Its done".
You might want to post in the GIT[^] if you want to use Hindi as your means to ask questions.
Also, always vote if it helps.
|
|
|
|
|
ok sir ....and thank you
|
|
|
|
|
sir i want to provide path through " open file dialog box "
...how can i get the path where i want to save my backup file using this dialog box ...plz help thanx in advance
|
|
|
|
|
No idea, but this:
DateTime Time = DateTime.Now;
int year = Time.Year;
int month = Time.Month;
int day = Time.Day;
int hour = Time.Hour;
int minute = Time.Minute;
int second = Time.Second;
int millisecond = Time.Millisecond;
//Save file to C:\ with the current date as a filename
string path;
path = "C:\\MySqlBackup" + year + "-" + month + "-" + day +
"-" + hour + "-" + minute + "-" + second + "-" + millisecond + ".sql";
can be reduced to:
string path = System.String.Format ( @"C:\MySqlBackup{0:yyyy-MM-dd-HH-mm-ss-fff}.sql" , System.DateTime.Now ) ;
|
|
|
|
|
I need to implement the simple encryption function below in C#. Anyone that knows Delphi and C# able to help?
function EncryptStr(const S: String; Key: Word): String;
var
I: Integer;
const
C1 = 53761;
C2 = 32618;
begin
Result := S;
for I := 1 to Length(S) do begin
Result[I] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(Result[I]) + Key) * C1 + C2;
end;
end;
|
|
|
|
|
In C# characters are 2 bytes wide so probably want to first convert the string into an array of bytes. At that step, you have to choose which encoding you want to use. Once you have such an array, you can then apply the above algorithm on it. But be aware that the resulting array of bytes might not be valid for the selected encoding and thus it might be somewhat problematic to return a string. Also because of encoding, the final length might also be different. So you have to know exactly what you want to do and if you want to properly support any valid string or only those that are limited to the ANSI character set.
Philippe Mori
|
|
|
|
|
Not true. Characters are only two bytes wide if you use UTF16 encoding (and I've never seen anyone do so). In UTF8, some characters are 1, some are 2 and some are more. You can also force it to read bytes as ANSI characters using Encoding.Default.
I agree though that in .Net it's better to do algorithms like this on byte arrays not character ones, if possible.
|
|
|
|
|
Sorry, but Philippe is right.
.NET always use UTF-16 encodings for strings. And as he correctly mentions you can select the encoding to use when converting to/from a byte array. You can not select encoding to use in a string.
|
|
|
|
|
I'm not sure that's actually true either (you can put Unicode code page 2, i.e. UTF32, characters in a .Net string, right?). But since you can never get at the internal representation of a string anyway, it's irrelevant ... the only time byte count matters is when you convert a string to bytes (or vice versa), and the default for that is definitely UTF8. How the string is actually stored internally is implementation dependent and probably depends on what's actually in the string.
|
|
|
|
|
UTF-32 is just again another encoding of the Unicode characterset. It does not contain any character that can't be represented by UTF7, UTF-8, or UTF-16. But unlike these encodings UTF-32 has a fixed length of all characters (4 bytes) where for example UTF-16 use two or four bytes per character.
I seriously doubt the encoding of the string used for the in memory representation of the string depends on what is in it. If an implementation stored anything else than UTF-16, it would have to reencode every time you indexed a character in the string (including doing substrings, regex, etc). Sure it is possible, but it would be a lot of complexity added for no reasonable gain.
|
|
|
|
|
In C#, all characters are in Unicode.
Philippe Mori
|
|
|
|
|
You know, that was what Ridley Scott was going to run with before he went with "In space no one can hear you scream"?
|
|
|
|
|
Honestly, this is pretty trivial. If you don't know Delphi, how do you know this function does what you want? And if you don't know C# well enough to translate it, why are you writing a C# app?
The only subtlety is that the algorithm is working on bytes, so you should use a byte[] not a string, and the resulting byte stream might well not be translatable to a UTF8 string at all.
|
|
|
|
|
Hi All,
Question I have a string of Data that I am going to split with the method :
string[] Values = FileData.Split(delimeterCharFurther);
delimeterCharFurther are
char[] delimeterCharFurther = { '<', '>' };
I need to check the string before I split it that all the valid data is surrounded by < and >. I was thinking of a variable
for (int a = 0; a <= FileData.Length; a++)
{
Location = FileData.IndexOf("><");
MessageBox.Show(Location.ToString());
} but if I'm right that will only find the first, one way to do it I'm guessing is to search for a > without a following
|
|
|
|
|
IndexOf is overloaded, therefore location=string.IndexOf(subString, location+1); if often used in a loop for such purposes.
|
|
|
|