|
Do you mean sending rendred output of gridview/details view ? You need to work with RenderControl() method. Here[^] is an article.
|
|
|
|
|
I had not seen this article but it sounds like what I need.
Thanks for the help!
|
|
|
|
|
Hi,
I'm writing a program on the .NET compact framework to connect to the MPD musicplayer via a wifi connection. When I run the program from the simulator it runs fine. However when I deploy the software on the real device, I see the strange fenomenom, that I get the same data back from the the Networkstream object twice (even when connected through the active sync app). I checked the network traffic and I can see no errors there, the messages are correctly in sync. The stream.read method however returns the same data twice, when I do a re-read the correct message is received and the software runs smoothly furtheron. I disabled the optimizer, played around with the socket options, without any result. Adding delays between send and receive doesn't help either, however I do see a difference in debug and release versions. Stepping through the code does not show the problem anymore.
// the code i use to send and receive
protected void sendCommand(string command)
{
if (stream != null)
{
mLock.WaitOne();
OnLog(">>" + command + "\r\n");
byte[] sendBytes = System.Text.Encoding.ASCII.GetBytes(command + "\r\n");
connection.GetStream().Write(sendBytes, 0, sendBytes.Length);
}
}
protected string readResponse(bool check)
{
if (stream != null)
{
byte[] myReadBuffer = new byte[connection.ReceiveBufferSize];
NetworkStream myStream = connection.GetStream();
StringBuilder response = new StringBuilder();
int numberOfBytesRead = 0;
if (stream.CanRead)
{
do
{
numberOfBytesRead = myStream.Read(myReadBuffer, 0, myReadBuffer.Length);
response.Append(Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead));
commander.addDatatrafic(numberOfBytesRead);
}
while (myStream.DataAvailable && numberOfBytesRead > 0);
OnLog("<<" + Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead) + "\r\n");
response.Replace("\n", "\r\n");
if (check)
{
if (!checkOK(response.ToString()) && !checkFailed(response.ToString()))
{
response.Append(readResponse());
}
}
mLock.ReleaseMutex();
//lastresponse = response.ToString();
return response.ToString();
}
return "";
}
else
{
return "";
}
}
Anybody any ideas?
Regrards,
eric
modified on Monday, April 14, 2008 4:45 PM
|
|
|
|
|
Hi there,
i have an application developed for Windows Xp on VS2003 which uses Microsoft.ApplicationBlocks.Data.dll. Now i wish to migrate the application to windows vista for which i first need to migrate my code to VS2005. i want to know whether Microsoft.ApplicationBlocks.Data.dll is compatible to VS2005 and subsequently Vista. If no, then what are the workarounds or what else should i do.
Hope for help
Best Regards,
Mustanseer
|
|
|
|
|
It depends on the version of the ApplicationBlock you're using, not the name of the .DLL. But, generally speaking, yes, it'll work.
|
|
|
|
|
Well, he asked in three forums, and finally got an answer
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Well, he asked in three forums, and finally got an answer
Damn - he broke the duck.
|
|
|
|
|
Bugger! I didn't even bother to look before responding... Too late to smack him around now...
|
|
|
|
|
I want to create a method that maked the scrollbars of a textbox control visible only if needed.
I tried to use the following method but it doesn't always work, because some times is the control's width much bigger than the Height (I am talking when the WordWrap is set to False):
Private Sub TextBox1_TextChanged(ByVal sender As TextBox, ByVal e As System.EventArgs) _<br />
Handles TextBox1.TextChanged, TextBox1.Resize, TextBox1.FontChanged<br />
<br />
Dim fS As Size = TextRenderer.MeasureText(sender.Text, sender.Font)<br />
Dim cS As Integer = fS.Height * fS.Width<br />
Dim dS As Integer = sender.Size.Height * sender.Size.Width<br />
If dS < cS Then<br />
sender.ScrollBars = ScrollBars.Both<br />
Else<br />
sender.ScrollBars = ScrollBars.None<br />
End If <br />
End Sub
so here is some findings about the text box's control behaviour, maybe it's gonna be useful:
these numbers just bellow (123456) charachterize th number of lines
1 2 3 4 5 6
10 6 22 38 54 70 86 16^
11 6 24 42 60 78 96 18^
12 6 26 46 66 86 106 20^
13 6 28 50 72 94 126 22^
0 2 4 6 8 10 ^the numbers in this col. are the control's increment per font against line
^this column is the textbox's font's size
the numbers within the table (6,22,38~72,94,126) are the Size.Height of the control, corresponding to font size and line numbers.
well I don't want to waste your time,
does any body have any solution?
thanks for your time.
Shimi
|
|
|
|
|
this what I have made, and it does the trick (my WrapLines is set to false I didn't check when true):
private void tbScroll(object sender, EventArgs e)<br />
{<br />
TextBox tb = (TextBox)sender;<br />
Size tS = TextRenderer.MeasureText(tb.Text, tb.Font);<br />
bool Hsb = tb.ClientSize.Height < tS.Height + int.Parse(tb.Font.Size);<br />
bool Vsb = tb.ClientSize.Width < tS.Width;<br />
<br />
<br />
if (Hsb && Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Both;<br />
}<br />
else if (!Hsb && !Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.None;<br />
}<br />
else if (Hsb && !Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Vertical;<br />
}<br />
else if (!Hsb && Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Horizontal;<br />
}<br />
<br />
sender = (object)tb;<br />
}
this event is raised at TextChanged and at ClientSizeChanged
Shimi
|
|
|
|
|
Hi,
I am using PayPal for online payment. I want to use DoDirectPayment method of PayPal.
Please tell me whether this method accept payment in Australian Dollar (AUD) or Applicable in Australia.
Thanks in Advance
regards
Samrat Mandal
|
|
|
|
|
Why are so many people asking paypal questions here instead of asking Paypal, or reading their docs ? Or is it just you flooding the boards ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what's new in dotnet framework 2.0 architecture compared to dotnet framework 1.1 architecture.
difference between architecture diagram of dotnet framework1.1 and architecture diagram of dotnet framework2.0
Please help me in this.
|
|
|
|
|
Have you heard of google?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Wow, this question is about 3 years old now. Next, you'll be asking about what different between 2.0 and 3.0, and then 3.0 to 3.5, and then 3.5 to 4.0 (not even in Beta yet.)
Google for "differences between .net 1.1 2.0".
|
|
|
|
|
Hi All,
My last message post dropped the Xml lines so I'll substitute round brackets.
I am reading Xml data using XmlTextReader on a file stream.
I read the elements and the element attributes with no problem but I can't figure out how to identify if the current element has further child elements or is finalized (ends with />.
I can handle
(MyElement Name="MyName" Value="MyValue")(/MyElement)
(the reader.Read() shows 'Element' (with 2 attributes) then EndElement - no problem)
I have problems with
(MyElement Name="MyName" Value="MyValue" /)
(the reader.Read() shows 'Element' (with 2 attributes) then the next element)
In the second case I can't figure out if the next element is a child element or not. Or to be more precise I don't know when the original element ends.
Thanks.
|
|
|
|
|
coleydog wrote: My last message post dropped the Xml lines so I'll substitute round brackets.
The 'Ignore HTML tags in this message (good for code snippets)' is good for that. Or if Auto-encode HTML when pasting? is checked ( which it is by default ) copying and pasting your code instead of typing it will do it for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use the IsEmptyElement property of the XmlTextReader:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
namespace ReadingXmlText
{
class Program
{
static void Main(string[] args)
{
String data = "<root><standard attributeA=\"value\" attributeB=\"value2\"></standard><emptyElement attributeA=\"value\" attributeB=\"value2\" /></root>";
StringReader stream = new StringReader(data);
XmlTextReader rdr = new XmlTextReader(stream);
while (rdr.Read())
{
Console.Write(rdr.Name + ": ");
Console.Write(rdr.NodeType);
if (rdr.IsEmptyElement)
Console.WriteLine(" (Empty)");
else
Console.WriteLine();
}
}
}
}
Mark's blog: developMENTALmadness.blogspot.com
Funniest variable name:
lLongDong - spotted in legacy code, was used to determine how long a beep should be. - Dave Bacher
|
|
|
|
|
Thanks,
That's exactly the property I was looking for.
Cheers.
|
|
|
|
|
Hi All,
I am reading Xml data using XmlTextReader on a file stream.
I read the elements and the element attributes with no problem but I can't figure out how to identify if the current element has further child elements or is finalized (ends with />).
I can handle
<myelement name="MyName" value="MyValue">
(the reader.Read() shows 'Element' (with 2 attributes) then EndElement - no problem)
I have problems with
<myelement name="MyName" value="MyValue">;
(the reader.Read() shows 'Element' (with 2 attributes) then the next element)
In the second case I can't figure out if the next element is a child element or not. Or to be more precise I don't know when the original element ends.
Thanks.
|
|
|
|
|
Why not just load the entire document into an XmlDocument instead?? Then you can get all the child element collection information you want?
|
|
|
|
|
Thanks for that. That's what I've now done. Works fine. I just thought there would have to be some sort of 'HasEndElement' type property for an Element node on the XmlTextReader.Read Element.
Cheers.
|
|
|
|
|
Since the Reader hasn't gotten that far, there's no way for it to tell...
|
|
|
|
|
hi i want to display the IL( intermediate language) from assembly.
have any tricks?
My small attempt...
|
|
|
|
|
You can use ILDASM, which comes with the .NET Framework SDK, or you can use .NET Reflector (Google for ".NET Reflector").
|
|
|
|