Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting Strings to Hex Pin
Dan Neely3-Oct-05 6:53
Dan Neely3-Oct-05 6:53 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 8:44
Guinness4Strength3-Oct-05 8:44 
AnswerRe: Converting Strings to Hex Pin
Dario Solera3-Oct-05 7:06
Dario Solera3-Oct-05 7:06 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 8:43
Guinness4Strength3-Oct-05 8:43 
GeneralRe: Converting Strings to Hex Pin
Dario Solera3-Oct-05 9:08
Dario Solera3-Oct-05 9:08 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 9:12
Guinness4Strength3-Oct-05 9:12 
GeneralRe: Converting Strings to Hex Pin
Dario Solera4-Oct-05 5:25
Dario Solera4-Oct-05 5:25 
QuestionISerializable problems Pin
g00fyman3-Oct-05 3:53
g00fyman3-Oct-05 3:53 
hi to all,

can some one please tell me why i get
<br />
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll<br />
<br />
Additional information: Exception has been thrown by the target of an invocation.<br />


for this class, it was working fine until i added the serialization of the ping counter, i tried subclassing the ISerializable in the IPingResponse interface instead but i get the same error

<br />
using System;<br />
using System.Runtime.Serialization;<br />
<br />
<br />
namespace RemotingInterface<br />
{<br />
  /// <summary><br />
  /// Encapsulates a response being sent back from remoting server to client<br />
  /// data included is simple statistics on the servers status<br />
  /// </summary><br />
  [Serializable()]<br />
  public class PingResponse : ISerializable, IPingResponse<br />
  {<br />
    // set when the request is made on this object.<br />
    private DateTime requestTime;<br />
<br />
    // set by the requestor, so a transmission time can be established    <br />
    private DateTime receiveTime;<br />
<br />
    // the number of pings since instantiation<br />
    private int pings;<br />
<br />
<br />
    #region Serialisation Functions<br />
    <br />
    /// <summary><br />
    /// Deserialization constructor<br />
    /// </summary><br />
    /// <param name="info"></param><br />
    /// <param name="ctxt"></param><br />
    public PingResponse(SerializationInfo info, StreamingContext ctxt)<br />
    {<br />
      this.requestTime = (DateTime)info.GetValue("RequestTime", typeof(DateTime));    <br />
      this.receiveTime = (DateTime)info.GetValue("ReceiveTime", typeof(DateTime));    <br />
      this.pings = (int)info.GetValue("PingCount", typeof(int));    <br />
    }<br />
    <br />
    /// <summary><br />
    /// Serialization function<br />
    /// </summary><br />
    /// <param name="info"></param><br />
    /// <param name="ctxt"></param><br />
    public void GetObjectData(SerializationInfo info, StreamingContext ctxt)<br />
    {<br />
      info.AddValue("RequestTime", this.requestTime);<br />
      info.AddValue("ReceiveTime", this.receiveTime);<br />
      info.AddValue("PingCount", this.pings);<br />
    }<br />
    <br />
    #endregion Serialisation Functions<br />
<br />
    /// <summary><br />
    /// <br />
    /// </summary><br />
    /// <param name="request"></param><br />
    public PingResponse(DateTime request)<br />
    {<br />
      this.requestTime = request;<br />
    }<br />
<br />
<br />
    /// <summary><br />
    /// <br />
    /// </summary><br />
    public DateTime ReceiveTime<br />
    {<br />
      set<br />
      {<br />
        this.receiveTime = value;<br />
        this.pings++;<br />
      }<br />
    }<br />
<br />
    /// <summary><br />
    /// <br />
    /// </summary><br />
    public TimeSpan TransmissionTime<br />
    {<br />
      get<br />
      {<br />
        return this.receiveTime - this.requestTime;<br />
      }<br />
    }<br />
<br />
    public int PingCount<br />
    {<br />
      get<br />
      {<br />
        return this.pings;<br />
      }<br />
    }<br />
  }<br />
}<br />


kind regards,
g00fy
AnswerRe: ISerializable problems Pin
Robert Rohde3-Oct-05 7:27
Robert Rohde3-Oct-05 7:27 
GeneralRe: ISerializable problems Pin
g00fyman3-Oct-05 13:47
g00fyman3-Oct-05 13:47 
GeneralRe: ISerializable problems Pin
Robert Rohde3-Oct-05 20:40
Robert Rohde3-Oct-05 20:40 
GeneralRe: ISerializable problems Pin
g00fyman3-Oct-05 20:59
g00fyman3-Oct-05 20:59 
QuestionPolar Graph in c#?? Pin
parvinder sehrawat3-Oct-05 3:30
parvinder sehrawat3-Oct-05 3:30 
AnswerRe: Polar Graph in c#?? Pin
Robert Rohde3-Oct-05 7:20
Robert Rohde3-Oct-05 7:20 
QuestionWriting code for Credit Card Reader in C# Pin
CharlyBrownson3-Oct-05 3:05
CharlyBrownson3-Oct-05 3:05 
AnswerRe: Writing code for Credit Card Reader in C# Pin
g00fyman3-Oct-05 4:09
g00fyman3-Oct-05 4:09 
GeneralRe: Writing code for Credit Card Reader in C# Pin
CharlyBrownson3-Oct-05 14:25
CharlyBrownson3-Oct-05 14:25 
GeneralRe: Writing code for Credit Card Reader in C# Pin
g00fyman3-Oct-05 15:44
g00fyman3-Oct-05 15:44 
QuestionC# and authenticating with LDAP Pin
ehuysamer3-Oct-05 2:49
ehuysamer3-Oct-05 2:49 
QuestionPassing Passwords ARGS Pin
har04mich3-Oct-05 2:30
har04mich3-Oct-05 2:30 
AnswerRe: Passing Passwords ARGS Pin
ehuysamer4-Oct-05 4:25
ehuysamer4-Oct-05 4:25 
QuestionGDI+ Problemo Pin
XeoN-Kc3-Oct-05 2:05
XeoN-Kc3-Oct-05 2:05 
AnswerRe: GDI+ Problemo Pin
leppie3-Oct-05 3:12
leppie3-Oct-05 3:12 
AnswerRe: GDI+ Problemo Pin
Andrew Kirillov3-Oct-05 3:44
Andrew Kirillov3-Oct-05 3:44 
GeneralRe: GDI+ Problemo Pin
XeoN-Kc3-Oct-05 7:55
XeoN-Kc3-Oct-05 7:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.