Click here to Skip to main content
15,898,855 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reverse GeoCoding Pin
Pete O'Hanlon7-Oct-13 11:57
mvePete O'Hanlon7-Oct-13 11:57 
GeneralRe: Reverse GeoCoding Pin
Kevin Marois7-Oct-13 12:00
professionalKevin Marois7-Oct-13 12:00 
GeneralRe: Reverse GeoCoding Pin
Pete O'Hanlon7-Oct-13 12:13
mvePete O'Hanlon7-Oct-13 12:13 
GeneralRe: Reverse GeoCoding Pin
Kevin Marois7-Oct-13 12:40
professionalKevin Marois7-Oct-13 12:40 
GeneralRe: Reverse GeoCoding Pin
Pete O'Hanlon7-Oct-13 13:03
mvePete O'Hanlon7-Oct-13 13:03 
GeneralRe: Reverse GeoCoding Pin
Mycroft Holmes7-Oct-13 13:02
professionalMycroft Holmes7-Oct-13 13:02 
AnswerRe: Reverse GeoCoding Pin
Bernhard Hiller7-Oct-13 21:35
Bernhard Hiller7-Oct-13 21:35 
QuestionBAD DATA IN CLIENT SERVER APP ?! Pin
Eng Abdullah Albishri7-Oct-13 5:41
professionalEng Abdullah Albishri7-Oct-13 5:41 
hi there !

i have BAD DATA EXP !

MY APP WORK FINE IN LOCAL BUT WHEN I RUN IT IN THE NETWORK THE SERVER APP THROW THE BAD DATA EXP !?

CODE : C#

CLIENT :

C#
public byte[] ENC(string strdata, CspParameters prk)
      {
          RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(prk);
          byte[] data = rsa.Encrypt(Encoding.Unicode.GetBytes(strdata),false);
          MessageBox.Show(data.Length.ToString());/////test
          return data;
      }

void clint(byte[] data)
        {
            try
            {

                object op = (object)data;
                BinaryFormatter br = new BinaryFormatter();
                TcpClient myclient = new TcpClient("192.168.43.152", 7000);// server to conecting
                NetworkStream myns = myclient.GetStream();
                br.Serialize(myns, op);
                myclient.Close();
                

            }
            catch (Exception e)
            {
                
                clint(data);
            }
        }

/////////////////

.
.
.
CspParameters cp = new CspParameters();
                   cp.KeyContainerName = "25522100";
                   string usb = ":RIO";

                   string Name = System.Environment.MachineName;

                   Name += usb;

                   mymsg = ENC(Name, cp);


                   clint(mymsg);




SERVER :
C#
<pre> mytcp = new TcpListener(7000);
                mytcp.Start();
                mysocket = mytcp.AcceptSocket();
                myns = new NetworkStream(mysocket);
                BinaryFormatter br = new BinaryFormatter();
                object op;
                op = br.Deserialize(myns);
                data = (byte[])op;
                MessageBox.Show(data.Length.ToString());
CspParameters cp = new CspParameters();
                cp.KeyContainerName = "25522100";
byte[] messge = DEC(data, cp);

//////////////////////
.
.
.
C#
public byte[] DEC(byte[] en_data, CspParameters key)
     {
         RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(key);
         byte[] data1 = rsa.Decrypt(en_data, false);
         return data1;
     }


ANY HELP !

modified 7-Oct-13 12:35pm.

AnswerRe: BAD DATA IN CLIENT SERVER APP ?! Pin
Eddy Vluggen7-Oct-13 7:07
professionalEddy Vluggen7-Oct-13 7:07 
GeneralRe: BAD DATA IN CLIENT SERVER APP ?! Pin
Eng Abdullah Albishri7-Oct-13 7:25
professionalEng Abdullah Albishri7-Oct-13 7:25 
GeneralRe: BAD DATA IN CLIENT SERVER APP ?! Pin
Eddy Vluggen8-Oct-13 0:30
professionalEddy Vluggen8-Oct-13 0:30 
AnswerRe: BAD DATA IN CLIENT SERVER APP ?! Pin
Bernhard Hiller7-Oct-13 21:37
Bernhard Hiller7-Oct-13 21:37 
GeneralRe: BAD DATA IN CLIENT SERVER APP ?! Pin
Eng Abdullah Albishri8-Oct-13 2:18
professionalEng Abdullah Albishri8-Oct-13 2:18 
QuestionSendKeys.Send instead SendKeys.SendWait Pin
M Riaz Bashir6-Oct-13 21:53
M Riaz Bashir6-Oct-13 21:53 
AnswerRe: SendKeys.Send instead SendKeys.SendWait Pin
BillWoodruff7-Oct-13 7:54
professionalBillWoodruff7-Oct-13 7:54 
AnswerRe: SendKeys.Send instead SendKeys.SendWait Pin
Dave Kreskowiak7-Oct-13 9:29
mveDave Kreskowiak7-Oct-13 9:29 
QuestionHow to play mp4 video byte array Pin
angelai6-Oct-13 13:33
angelai6-Oct-13 13:33 
AnswerRe: How to play mp4 video byte array Pin
Abhinav S6-Oct-13 23:29
Abhinav S6-Oct-13 23:29 
QuestionGuaging article interest about MEF before I start writing Pin
-james6-Oct-13 13:24
professional-james6-Oct-13 13:24 
AnswerRe: Guaging article interest about MEF before I start writing Pin
BillWoodruff6-Oct-13 14:26
professionalBillWoodruff6-Oct-13 14:26 
GeneralRe: Guaging article interest about MEF before I start writing Pin
-james6-Oct-13 15:30
professional-james6-Oct-13 15:30 
AnswerRe: Guaging article interest about MEF before I start writing Pin
Brisingr Aerowing6-Oct-13 14:35
professionalBrisingr Aerowing6-Oct-13 14:35 
GeneralRe: Guaging article interest about MEF before I start writing Pin
-james6-Oct-13 15:36
professional-james6-Oct-13 15:36 
AnswerRe: Guaging article interest about MEF before I start writing Pin
Mycroft Holmes6-Oct-13 16:54
professionalMycroft Holmes6-Oct-13 16:54 
AnswerRe: Guaging article interest about MEF before I start writing Pin
Pete O'Hanlon7-Oct-13 0:17
mvePete O'Hanlon7-Oct-13 0:17 

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.