|
Your question is much too broad to be answered in a single reply. Check out this[^] article (one of many you can find on the web) to help you get started.
/ravi
|
|
|
|
|
Your question is too broad. You may want to narrow it down. Take it easy with the smileys
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks, Paul
I am almost still on paper work before putting down the codes.I am still on the tables.
If my Table is Transaction,
I should be having
::Deposite
::Withdrawal
:: and few more
In case of Customer,
I should be having
::Customer
::Services
:: and few more.
Getting the Hint??
KIDO KIDI MINI REZA
HERE FIX DI MATURITY
SAMBA RAMBA DIBLO
STYLE ANTIDIZASTA
BLISH MANTIRIOLOJ
|
|
|
|
|
hi
I want hiden the window of my project in the ConsoleApplication
but I don't know how I can doning it
please help me if you know about it
regard
|
|
|
|
|
You must tell the system to start the application without a window. The following code will do it:
<br />
ProcessStartInfo psinfo = new ProcessStartInfo("MyConsoleApp.exe");<br />
psinfo.UseShellExecute = false;<br />
psinfo.CreateNoWindow = true;<br />
Process proc = Process.Start(psinfo);<br />
proc.WaitForExit();<br />
I don't think there is an easy way to hide the console window from the console application itself.
|
|
|
|
|
In addition to Christian's suggestion, I think you could instead create a Windows Forms application and simply not create or display the main form.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: I think you could instead create a Windows Forms application and simply not create or display the main form.
That would be certainly a bit less coding.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi
I want to send different files to different clients but at same time from server.
I've successfully sent a file to a single client and then to multiclients but at different times using threads.
As when server is sending a file to one client and during that transmission if another clients requests for a file then 1st transmission stops and 2nd one also gets prob.
so plz try to tell ASAP the appropriate solution for this.
Regards.
Shanzay
|
|
|
|
|
How are you "sending" files?
How does a client "request" transmission of a file?
A WCF service is one way to easily solve this problem.
/ravi
|
|
|
|
|
I used UDP protocol for sending Video files and by using streaming I m sending.At first Server Rcv one message for sending files then send file,the Code for sending file is as following using threads.
private void liveVideoToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
try<br />
{<br />
Control.CheckForIllegalCrossThreadCalls = false;<br />
thvideo = new Thread(new ThreadStart(transmitVideo));<br />
thvideo.IsBackground = true;<br />
thvideo.Start();<br />
}<br />
catch (ThreadStartException thre)<br />
{<br />
MessageBox.Show(thre.Message);<br />
}<br />
<br />
<br />
}<br />
<br />
void transmitVideo()<br />
{<br />
<br />
<br />
<br />
filesndsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);<br />
<br />
ipd = new IPEndPoint(IPAddress.Any, 7090);<br />
filesndsock.Bind(ipd);<br />
MulticastOption moi = new MulticastOption(IPAddress.Parse("224.0.0.1"));<br />
filesndsock.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, moi);<br />
<br />
ipep = (EndPoint)ipd;<br />
while (true)<br />
{<br />
try<br />
{<br />
<br />
filesndsock.ReceiveFrom(rcvbuf, ref ipep);<br />
<br />
<br />
msg = Encoding.ASCII.GetString(rcvbuf);<br />
<br />
MessageBox.Show(msg);<br />
try<br />
{<br />
thvideofile = new Thread(new ThreadStart(sendfile));<br />
thvideofile.IsBackground = true;<br />
thvideofile.Start();<br />
}<br />
catch (ThreadStartException thre)<br />
{<br />
MessageBox.Show(thre.Message);<br />
}<br />
}<br />
catch (Exception ee)<br />
{<br />
MessageBox.Show(this, ee.Message, "Unknown Exception");<br />
}<br />
}<br />
}<br />
void sendfile()<br />
{<br />
<br />
if (dlgOpen.ShowDialog() == DialogResult.OK)<br />
{<br />
inStream = File.OpenRead(dlgOpen.FileName);<br />
<br />
bufInStream = new BufferedStream(inStream);<br />
int bytesRead = 0;<br />
<br />
while ((bytesRead = bufInStream.Read(buf, 0, 16384)) > 0)<br />
{<br />
Thread.Sleep(20);<br />
<br />
filesndsock.SendTo(buf, bytesRead, SocketFlags.None, ipep); <br />
<br />
} <br />
}<br />
MessageBox.Show("File is completely transfered");<br />
<br />
bufInStream.Close();<br />
inStream.Close();<br />
<br />
}
But for sending same time to multi clients what should I do?
-- modified at 4:28 Saturday 1st December, 2007
-- modified at 5:04 Saturday 1st December, 2007
Shanzay
|
|
|
|
|
|
If I put the values 5 and 2 in the TextBoxes txtValor1 and txtValor2,
in the TextBox txtResultado appear 2 and not 2.5 .
Why?
My code is:
<br />
long valor1,valor2;<br />
double resultado;<br />
<br />
valor1 = int.Parse(txtValor1.Text);<br />
valor2 = int.Parse(txtValor2.Text);<br />
<br />
if (opcDivide.Checked)<br />
{<br />
resultado=valor1/valor2;<br />
txtResultado.Text=Convert.ToString(resultado);<br />
}<br />
<br />
Thanks.
|
|
|
|
|
when you divide this two values try to cast and initialize to result
spaps
|
|
|
|
|
THe Result has to be cast into string...
TxtResult.Text= result.ToString();
-Sreejith
|
|
|
|
|
What did the debugger indicate?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
PeterRoman wrote: If I put the values 5 and 2 in the TextBoxes txtValor1 and txtValor2,
in the TextBox txtResultado appear 2 and not 2.5 .
Why?
Because the result of an integer division is an int. Thus the correct answer for 5/2 is 2.
If you want an answer of 2.5 you must use doubles.
|
|
|
|
|
<br />
<br />
double valor1,valor2;<br />
double resultado;<br />
<br />
valor1 = (double) txtValor1.Text;<br />
valor2 = (double) txtValor2.Text;<br />
<br />
if (opcDivide.Checked)<br />
{<br />
resultado=valor1/valor2;<br />
txtResultado.Text=Convert.ToString(resultado);<br />
}<br />
<br />
<br />
You code will fall over as soon as some bright spark enters a non number into your texbox, put a validator on it.
|
|
|
|
|
Though this isn't particularly robust code. Better would be to use something like:
double valor1, valor2;<br />
double resultado;<br />
<br />
if (!double.TryParse(txtValor1.Text, valor1))<br />
{<br />
valor1 = 0;<br />
}<br />
if (!double.TryParse(txtValor2.Text, valor2))<br />
{<br />
valor2 = 0;<br />
}<br />
<br />
if (opcDivide.Checked)<br />
{<br />
try<br />
{<br />
resultado = valor1/valor2;<br />
txtResultado.Text = resultado.ToString();<br />
}<br />
catch (DivideByZeroException e)<br />
{<br />
txtResultado.Text = "Error";<br />
}<br />
}
HTH
Dave
It definitely isn't definatley
|
|
|
|
|
Hi,
two comments:
1.
moon_stick wrote: if (!double.TryParse(txtValor1.Text, valor1))
{
valor1 = 0;
}
can be simplified to double.TryParse(txtValor1.Text, valor1)
which does exactly the same, given the following from MSDN:
"When this method returns, contains the double-precision floating-point number equivalent to
the s parameter, if the conversion succeeded, or zero if the conversion failed. The conversion
fails if the s parameter is a null reference (Nothing in Visual Basic), is not a number in a
valid format, or represents a number less than MinValue or greater than MaxValue. This
parameter is passed uninitialized."
2.
It would be better to produce some error indication when TryParse fails.
With your code:
- a mistake in valor1 results in zero, which may be confusing
- a mistake in valor2 results in a divide by zero with a misleading error text
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi Luc,
Of course you're right - I just couldn't be bothered checking the MSDN documentation to see what was returned if the cast failed sp decided to try and cover my bases.
I was treating the code as if it were working on a simple calculator and limited the range of error messages. In any case, I said it was better, not perfect!!
Dave
It definitely isn't definatley
|
|
|
|
|
This code is very good and the Dave too.
Thanks.
|
|
|
|
|
Can I work with linq using visual 2005 ?
Is there any kind of extension ?
Does it also mean that I can use xlinq (linq to xml) ?
|
|
|
|
|
It may be possible, if you have the .NET Framework 3.5, to use the Linq namespace in Visual Studio 2005, but you will not be able to use the LINQ syntax as they are a part of the C# 3.0 compiler. But since this syntax is just sugar that compiles down to using the appropriate classes then you can probably still use it, it will just not look as pretty.
|
|
|
|
|
Linq has been introduced as part of .NET 3.5, which doesn't run in VS2005. I'm afraid you need one of the VS2008 editions. Once you get it, you can use DLinq and XLinq to your hearts content.
|
|
|
|
|
You can use LINQ in almost any data source, its the higher level code that uses it not the backend database.
|
|
|
|