|
The exact path is
LoadLibraryW("C:\\Program Files\\MyApp\\");
|
|
|
|
|
Where's the DLL name? You've just provided a path there - there's no DLL details, so how can you expect LoadLibraryW to pick up the DLL?
|
|
|
|
|
for example - 1.milk breade & pad
2 milk (breade) & pad
3 milk (breade) & pad.
4 milk braede
i tried very much but not success please hepl me
|
|
|
|
|
A couple of points.
1. There's a Regular Expressions[^] forum. That would be a much more appropriate location for this question.
2. You haven't actually said what you expect the output to be.
|
|
|
|
|
i m providing code which i am running and getting exception plz help in this regard thanx ....
public void Backup()
{
// Process.Start("IExplore.exe");
try
{
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";
StreamWriter file = new StreamWriter(path);
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "mysqldump";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}",
"root","123456","localhost","userdb");
psi.UseShellExecute = false;
Process process = Process.Start(psi); ///here is exception coming
string output;
output = process.StandardOutput.ReadToEnd();
file.WriteLine(output);
process.WaitForExit();
file.Close();
process.Close();
}
catch (IOException ex)
{
MessageBox.Show("Error , unable to backup!");
}
}
but when i run this code it is providing me runtime eroor exception ........".The system cannot find the file specified " at the line
Process process = Process.Start(psi);
|
|
|
|
|
You need to supply the full path when assigning the FileName to your ProcessStartInfo object as well as the extension. i.e
psi.FileName = @"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe";
Next time please put your code into a code block (use the code link above the input box and select your language) as this makes it much easier to read through your quaestion.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
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.
|
|
|
|