|
I don't send status messages, I only send data that is required.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
You said that the Java server is spamming you with responses. So I assumed they were unnecessary. If the responses are necessary then they are not spam and then only way to reduce them is to not send messages. Your TCP/IP stack on Windows and from within Java should both be using the Nagle Algorithm so as long as that is not disabled and you do not force a send then the best you can do is send data when you have it and request data when you need it.
If you want to reduce bandwidth for streaming extremely large files you can compress the files using build in compression (see the J# library since it will have the same compression libraries as Java will have access to) or you can author your own.
|
|
|
|
|
Hi all,
I am trying to write a database connection error to a Browser using Response.write("error message") command.
try
{
cnx.Open();
cmd.ExecuteNonQuery();
// sResult = int.Parse(par.Value.ToString());// 1 if successful insert
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
cnx.Close();
}
I would like to write the error message to a browser if connection is not possible.
can i do this?
resonse.write (Console.WriteLine(ex.Message));
|
|
|
|
|
This isn't my field of knowledge, but I would think that you would do Response.Write(ex.Message). As it is now, that line of code won't even compile
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
So your application is a console application? Why are you unable to write to the Console, the only thing I fear is that you are creating a windows forms application and you are still trying to write to the console.
|
|
|
|
|
Yes, the first answer (Computafreak's) is correct, Response.Write(ex.Message); if your writing an ASP.NET Web Application. But, looking at your code, I suspect you are writing a Windows Application due to your reference to Console.WriteLine() . This is a stretch, you want to send a Windows Application generated error message to a web browser window? Who's browser - yours, or a user of the application? At what URL?
I think you may want to CLARIFY your question with some more details on the type of application you are writing.
Regards,
Gary
|
|
|
|
|
Hi I am writting the following code to write into text file.After Checking whether the file exixt or not ,It is giving the following error.Can any one help.
Any solution to this problem would be appreciated.
public void Ping(string hostName)
{
string path;
path = @"C:\CheckList\checklist_"+DateTime.Now.ToString("yyyyMMdd")+".txt";
if (!File.Exists(path))
{
File.Create(path);
}
TextWriter tw = new StreamWriter(path,true);
Error comes when we create text writer.
|
|
|
|
|
File.Create returns an open stream to the file created, locking it.
|
|
|
|
|
Check if the file is being used by some other process?
Are you writing to a directory which is read only?
|
|
|
|
|
You don't need the if statement at all. If the file doesn't exist, the StreamWriter will create it
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
hi guys,
i am a newbie coder in c# and i am trying to code a program that will be executed on his own.i think this called logic bombs.i would appreciate if someone could give an outline of what i have to do..i don't want to write me code just the idea.
thanks in advance..
|
|
|
|
|
If you really mean Logic Bomb[^] then no one here is going to help you.
If you just want a standalone exe, then yes you can. If the required .net framework is installed on the target machine and the app has no external dependancies, the exe will run fine. If it's for a machine without the .net framework then take a trip to c++ land.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Well at least users stopped hiding their intentions (see Rajdeep.net) and just come out and say they have malicious intentions.
1 for the post, but 5 for having the balls to come out and say it.
|
|
|
|
|
EliottA wrote: users stopped hiding their intentions
The exact same thought crossed my mind
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Please, please, don't mention that name (he might come back)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
He was active recently (16th[^]) but in the C++ forum. He's probably finally figured out that he can't really write nasty stuff successfuly using a .NET language. I think C++ will be above his intellectual abilities though so the world will remain safe.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Bah, I posted a warning to the C++ members in that thread, specifically Superman who was more then helpful. Hopefully they see it and review his messages to limit the flow of direct code to him.
|
|
|
|
|
Son of a b*&^h, you where right. See few threads above.
|
|
|
|
|
Believe me, I wish I wasn't...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
A Logic bomb is a malicious piece of code which you will find no help in creating here.
only two letters away from being an asset
|
|
|
|
|
i want to code a windows service that will start alone,like an alarm clock..if t is malicious and is called logic bomb ..sorry i didn't know it...
|
|
|
|
|
It is possible to write windows services in .net.
It does not run itself though, you have to set up windows to startup the service for you and it is not called a logic bomb.
There is a guide on MSDN here[^] on how to create services.
Simon
|
|
|
|
|
Fair enough. Simon's given you the solution you need.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
frnds,
how to move focus of one component(textbox, date picker, combo...) to other component. with ENTER key?
i tried key press with ..... code
private void txtAppfrmNo_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
MessageBox.Show("to next box");
}
}
******************************************************************
this.txtAppfrmNo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtAppfrmNo_KeyPress);
****************************************************
its not working, where is the problem???
|
|
|
|
|