|
Beat me by the speed of my DSL
|
|
|
|
|
Should be:
thongdiep = "Chao," + ten + ".Co" + songuoi.ToString() +
"nguoitruocban,va" + tennguoitruoc + "la nguoi dung truocban";
Notice the assignment? thongdiep = at the beginning? its missing in your statement. You can't add strings together without putting them somewhere when you are done, thats what the compiler is trying to tell you.
|
|
|
|
|
Thanks you very much but i can not compile it.Can you help me to fix that code.Thanks
|
|
|
|
|
What error do you get when you try to compile?
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
I want to write a c#-application which is able to transfer zipped files (tar.gz) to Linux-Server using SSH. A SH-Script on this server has to evaluate the data and then give the answer back to the windows client via stdOut.
The command line in the terminal in Linux to do this looks like this:
cat dummy.tar.gz | ssh root@192.168.13.7 /bin/remoteEvaluation.sh params
As I am understanding the tar-file first gets loaded into the StdOutput of the client and then it gets piped to be the StandardInput for the connection to the server via SSH. In Evaluation.sh the StandardInput gets evaluated and then the results gets back to the client via stdoutput of ssh.
I have just found a lib (SSH.Net) and was able to successfully connect to the server via ssh and to be able to execute some commands on this server:
PrivateKeyFile key = new PrivateKeyFile(@"D:\Path\id_rsa");
SshClient sshClient = new SshClient("192.168.13.7", "usr", new PrivateKeyFile[] { key });
sshClient.Connect();
SshCommand cmd = sshClient.CreateCommand("ls -ltr");
cmd.Execute();
Console.WriteLine(cmd.Result);
sshClient.Disconnect();
It's a pity that I don't know how to get zipped tar-file via stdIn into the server, so that the evaluation.sh has some input to evaluate.
I recognized that the SSH.Net-Lib also provides a function named "CreateShell", which looks like follows:
public Shell CreateShell(Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModes, int bufferSize)
Furthermoe there is a function to create a Shellstream:
public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize)
Maybe I can use these functions to get the binary stream of the zipped file to the server.
If someone could give me a hint, how I can solve this problem I'd be very happy.
|
|
|
|
|
I Googled it and found this.[^]
It describes problem, but my table has a PK.
When I try to reference to table in code, it's not there.
Anyone know what's wrong?
If it's not broken, fix it until it is
|
|
|
|
|
Could be any one of a million things. Please try and be a bit more specific about what you are doing and what results you see.
Veni, vidi, abiit domum
|
|
|
|
|
There's nothing else to tell.
I drag a table from Server Explorer into the DBML Designer but it doesn't show in code.
If it's not broken, fix it until it is
|
|
|
|
|
|
Lo
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Any way the wind blows
Nothing really matters to me
|
|
|
|
|
to me.
Mama, just killed a man
Put a gun against his head
|
|
|
|
|
Pulled my trigger
Now he's dead
|
|
|
|
|
Mama, life had just begun
But now I've gone and thrown it all away
|
|
|
|
|
Mama. Ooo ooh oo oooooo
Didn't mean to make you cry.
|
|
|
|
|
If I'm not back again this time tomorrow
Carry on, carry on, as if nothing really matters
|
|
|
|
|
Look Here[^]
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|
|
I got this piece of code from, I know not where, as a recommended way to write to a file.
using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write))
{
StreamWriter sw = new StreamWriter(fs);
sw.Write(textBox1.Text);
sw.Close();
}
Any thoughts?
|
|
|
|
|
electriac wrote: Any thoughts? My first thought is, "what is your question"?
Veni, vidi, abiit domum
|
|
|
|
|
Does this appear to be correct?
|
|
|
|
|
Appearances can be deceiving. Why not test it for yourself to see what happens, you may be surprised at what you can learn that way.
Veni, vidi, abiit domum
|
|
|
|
|
The term "correct" would be dependent upon the codes overall purpose. Since we know nothing of what you're doing or why, it's impossible to answer the question.
|
|
|
|
|
electriac wrote: Any thoughts? Not only the stream is disposable, but also the streamwriter.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi,
I've been playing around with multi-threaded code, setting affinity on different threads, etc... In my particular application, I have noticed performance is actually better when avoiding running threads concurrently on certain processors.
To be more precise, I have an hyper-threaded CPU and when assigning work to both logical processing units inside a core, it takes longer to run. Perhaps my code isn't optimized, but that's besides the point.
So my question is: How can I detect which two (or more, I'd like to be future proof here) logical processing units are from the same core?
I've done some research online and found some information that has lead me to believe CPU0 and CPU1 would be from the same core and CPU2 and CPU3 from the other one, in an hyper-threaded dual core CPU. But my testing is telling me otherwise (CPU0/CPU2 and CPU1/CPU3).
Thanks in advance!
Nic
|
|
|
|