|
The only time that I've encountered SOAP is when dealing with web services. If all you need to do is pass data between 2 processes then standing up a web server just to use SOAP would be a lot of overkill.
|
|
|
|
|
|
Hey guys
I've been battling to get a response from a server using TcpClient. Now finally after 3 days of problems due to the learning curve I'm getting responses from the server
Here is the code at the moment.
private void ReceiveMessages()
{
try
{
srReceiver = new StreamReader(tcpServer.GetStream());
string result = string.Empty;
while (Connected)
{
char CurrentChar = (char)srReceiver.Read();
if (CurrentChar == RecordTerminator)
{
result += "[Record Terminator]";
}
else if (CurrentChar == FieldTerminator)
{
result += "[Field Terminator]";
}
else if (CurrentChar == PacketTerminator)
{
result += "[Packet Terminator]";
}
else
{
result += CurrentChar.ToString();
}
if (#########)
{
this.Invoke(new UpdateLogCallback(this.UpdateLog), new object[] { result });
result = string.Empty;
}
}
}
catch (Exception ex)
{
this.Invoke(new UpdateLogCallback(this.UpdateLog), new object[] { ex.Message });
}
}
Now one of the weirdness's I came across is that if I try StreamReader.ReadLine() I get empty strings as response.
If I use StreamReader.Read() I get the correct response, one character at a time.
Obviously i cant use the CallBack for every character received as this is way to slow, so what I'd like is to only send the use the callback after all the data has been read. But how do i know when its finished? IE what condition do i need to set instead of the #########? Cause if StreamReader.Read() is called and there is no data, it waits for some.
PS, I cant use the packet terminator as this is not always sent at the end of every packet response
Any ideas?
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
|
Just tried it.
It seems that its returning the size of the buffer array instead of 0 for EndOfStream or 1 for there's still data
If char[] Buffer = new char[12];
then Stream.Read(Buffer, 0, Buffer.Length); returns 12
bummer
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi Harvey,
reading one page of documentation on StreamReader class one can discover it has some 17 methods, and 3 properties one of them being called EndOfStream. I suggest you look into it.
On the other hand, StreamReader.Read returns an int, not a char, which you discovered since you had to add a cast to make it work. The reason for the int is documented as well.
Furthermore there is non-blocking Peek() method that might be useful.
One final remark: yours will not be the first TCP client; why don't you look at some of the CP articles about the subject?
Luc Pattyn [Forum Guidelines] [My Articles]
- 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 the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi
how can I resive and get binary file ?
I need to build function that convert txt file into binary file and send as bits ??
and to build function that can resive those bits and convert to txt file
is it posible ? and how ?
thank's in advance
|
|
|
|
|
Hi,
once more you get 1-voted as you fail to provide sufficient data for anyone to provide a useful answer.
the quality and detail of your question reflects on the effectiveness of the help you are likely to get
Luc Pattyn [Forum Guidelines] [My Articles]
- 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 the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Took me 6 minutes to get that resive = receive
|
|
|
|
|
EliottA wrote: Took me 6 minutes ...
You shouldn't spend more than 6 seconds on any post that fails to even attempt at explaining what it is about.
His message is already in binary.
Luc Pattyn [Forum Guidelines] [My Articles]
- 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 the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Presumably via sockets.
Search for "File Transfer Protocol" to read about that protocol.
Then search for a library that implements it. You will need a client, server or both depending on exactly what you are doing.
|
|
|
|
|
Do you really means send and receive as bits?
Or do you mean send and receive bytes?
If the latter try looking at the BinaryReader and BinaryWriter classes (together with StingReader and StringWriter?).
If you do mean sending and receiving bits you need to look at the bit shifting operators.
All stuff available via the help in VS (and possibly via Google).
Regards
David R
|
|
|
|
|
hi everyone i hope you can help me
so i needed a treelistview control and i downloaded a very good one very easy to use here
Updated Extended ListView[^]
it worked great, then i had to change the color of the font not in the nodes but in their subitems and thats when i have trouble and started crying because it seems to me you cant change the text color because subitems in this control dont have that property, i tried to implement it this way
private Color forecolor = SystemColors.WindowText;
[Category("Appearance")]
public Color ForeColor
{
get { return forecolor; }
set { forecolor = value; }
}
but it didnt work either so i guess my question is: can i somehow add a tree to a regular listview??
or another question: what did i do wrong when i tried implementing the property myself? (code above)
i mean the property forecolor was added to the subitem it just didnt work
i hope this makes sense to everyone and i could explain myself, thanks in advance people
|
|
|
|
|
You should really ask in the article's forum.
I've had a quick look though and it seems like all the painting for the rows is done in the ContainerListView.DrawRows method. You'll need to isolate the relevant lines and make sure your SubItem 's new ForeColor property is used to draw set the Brush /Pen colour for the Graphics.DrawString call, instead of the parent's.
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)
|
|
|
|
|
We use Infragistics wintreeview in outlookexpress mode and while I have never had to fiddle with the cell content colours the single biggest drawback with IG is the sheer number of properties you can set. I'd bet you can set the cell forecolor in that tool. They are expensive though!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all,
How to create a setup file in c#.net(3.5 windows application)
solution explorer--> add New project-->Other projects-->setup and Deployment-->Setup Project
Ok
up to here i did
but how to add uninstall option.
Thanks In Advance
--Naren
|
|
|
|
|
That's usually included automatically. Isn't there (after installation) an uninstall-option in the list when you click "Add/Remove Software" from the Configuration-window?
I are troll
|
|
|
|
|
Before Creating exe(publishing) can we display a window Form?
|
|
|
|
|
Hello Narendra!
Actually, the uninstall option is already present during setting up the Setup process in VS.NET. You just need to select it at the time of creating the Setup for your app/Software. And, displaying a windows form at the beginning of Installation (setup) to the client is possible, but not using Visual Studio setup creation process. For displaying a Form or messagebox at the time of Setup is only possible if you create your setup using other Setup wizard creating software. Go to Google or Live Search and seach for 'Setup Wizard creator'. Hope this helps,
Happy programming,
Rajdeep.NET.....
|
|
|
|
|
Hi Rajdeep,
Actually what i want exactly is
in my application i have some extra module, i want to create with that, without that.
so before publishing can i display a window with you want to include that module also?
here i want to give a radiobutton list with Yes, No. based on the selection i want to update in to sqlserver.
Is it possible?
hope you got my point.
--Naren
|
|
|
|
|
Hi All,
I am new to .net, can anbody help me is completeing my task.
On Button click How to set the focus to the process i am trying to open.
Waiting for reply.. Thanks in advance.
Have a good day!!!!!!!!
modified on Monday, April 6, 2009 1:47 PM
|
|
|
|
|
What have you tried?
Show the code from your ButtonClick eventhandler
Don't forget to put it between <pre></pre> tags to preserve the formatting.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I am looking for Open Source Library for RTP developement in .net.
I need to know about RTCP in RTP project:
1. How can i make RTCP packet?
2. RTCP automatically control the session rate mean quality for audio/video call?
How can possible to sycronize the audio and video in call?
Please send me link or sample code if anybody have.
Thanks in advance
Saurabh
|
|
|
|
|
Hi experts...
I need to (print/preview) a datagridview bound to a list, how can i do this?
Thanks in advance...
Christian
|
|
|
|
|
I would think that if you google 'datagridview AND printing', you might find something to suit. After all it's highly unlikely that you are the first to want to do this.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|