Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
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 
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 
hi Robert,

thank you for your help and patience.

i have the class marked as Serializable and i also implement the ISerializable interface

im not sure what the serializable attribute does, im thinking it just lets the clr know that this class need to be serialized then looks for a way to do it?

anyway this is the top part of my class, and yes i did notice the exception had changed, but i dont know why, all i did was put in the try catch

the rest of the class is just member accessors

<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 />
      <br />
      try<br />
      {<br />
        this.pings = (int)info.GetValue("Pings", typeof(int));    <br />
      }<br />
      catch(Exception e)<br />
      {<br />
        Console.WriteLine(e.Message);<br />
      }<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("Pings", this.pings);<br />
    }<br />
    <br />
    #endregion Serialisation Functions<br />


thanks again,

g00fy
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 
GeneralRe: GDI+ Problemo Pin
Andrew Kirillov3-Oct-05 9:40
Andrew Kirillov3-Oct-05 9:40 
QuestionWhy Leave the user defined control make the changes of the combobox? Pin
Ming Luo3-Oct-05 1:51
Ming Luo3-Oct-05 1:51 
QuestionBinding a property to a textbox problem Pin
Ming Luo3-Oct-05 0:53
Ming Luo3-Oct-05 0:53 
QuestionChange another forms controls properties Pin
freshonlineMax2-Oct-05 23:52
freshonlineMax2-Oct-05 23:52 

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.