Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Finding Windows Directory Pin
Brian D16-Jan-04 21:51
Brian D16-Jan-04 21:51 
GeneralTotal noob question Pin
georgiek5016-Jan-04 14:33
georgiek5016-Jan-04 14:33 
GeneralRe: Total noob question Pin
Michael Dunn16-Jan-04 14:45
sitebuilderMichael Dunn16-Jan-04 14:45 
GeneralRe: Total noob question Pin
georgiek5017-Jan-04 5:46
georgiek5017-Jan-04 5:46 
GeneralRe: Total noob question Pin
Michael Dunn17-Jan-04 6:20
sitebuilderMichael Dunn17-Jan-04 6:20 
GeneralRe: Total noob question Pin
georgiek5017-Jan-04 7:48
georgiek5017-Jan-04 7:48 
GeneralRe: Total noob question Pin
Andrew Walker16-Jan-04 19:13
Andrew Walker16-Jan-04 19:13 
Generalproblem with sending packet from client to server Pin
chirag_chauhan16-Jan-04 14:04
chirag_chauhan16-Jan-04 14:04 
Hi,

when i m trying to transfer the encoded packet after escape encoding it from client to server using foloowing code snippet.......

AES_EncodeForService(data,key,&res,&len);

// disard <aes_encode> &
strcpy(tempstr,"");
j=0;
for (i=12;i<strlen(res)-13;i++)
{
="" tempstr[j]="res[i];
" j="j+1;
" }
="" ;

="" escape="" encoding...........
="" strcpy(res,"");
="" strcpy(res,tempstr);
="" strcpy(tempstr,"");
="" for="" (i="0;i<strlen(res);i++)
" if="" (="" !(isalnum(res[i])))
="" sprintf(tempchar,"%s%x","%",__toascii(res[i]));
="" else
="" sprintf(tempchar,"%c",res[i]);
="" strcat(tempstr,tempchar);=""
="" combine="" encoded="" with="" tags.....
="" sprintf(withcode,"<aes_encode="">%s",tempstr);

// construct a packet with header followed by footer........
strcpy(packet,header);
strcat(packet,withCode);

// set buffer
len=strlen(packet);
sprintf(sendbuf,"POST /services/ws.asp HTTP/1.0\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: %d\r\n%s\r\n\r\n",len,packet);

// length of buffer
len=strlen(sendbuf);

// send packet..............
bytesSent = send(ConnectSocket,sendbuf,len,0);
printf("\nBytes Sent: %ld\n\n", bytesSent );

/// receive packet..........
bytesRecv = recv(ConnectSocket,recvbuf,10000,0);
// if doesn't receive the bytes.....
if (bytesRecv <= 0)
printf("\n Error : %d",WSAGetLastError());
// display the received content.........
else
{
printf("\n Receive buffer : %s\n\n",recvbuf);
AES_Decode(recvbuf,key,&recvData,&len);
printf("\n Decode : %s \n\n",recvData);
}

my problem is that the characters which r not aphanumeric get changed and hence does not able to decode it properly.

chirag_a_chauahn
GeneralRe: problem with sending packet from client to server Pin
valikac17-Jan-04 14:42
valikac17-Jan-04 14:42 
Generalfrom Jet to MSDE Pin
halblonious16-Jan-04 12:34
halblonious16-Jan-04 12:34 
GeneralRe: from Jet to MSDE Pin
l a u r e n16-Jan-04 14:05
l a u r e n16-Jan-04 14:05 
GeneralRe: from Jet to MSDE Pin
Roger Wright16-Jan-04 16:56
professionalRoger Wright16-Jan-04 16:56 
GeneralRe: from Jet to MSDE Pin
Jeremy Falcon17-Jan-04 5:23
professionalJeremy Falcon17-Jan-04 5:23 
QuestionHow to use setwindowpos with MDI Pin
vancouver77716-Jan-04 11:34
vancouver77716-Jan-04 11:34 
AnswerRe: How to use setwindowpos with MDI Pin
vancouver77719-Jan-04 6:25
vancouver77719-Jan-04 6:25 
GeneralRetrieving proxy info from IE settings Pin
haritadala16-Jan-04 11:33
haritadala16-Jan-04 11:33 
GeneralRe: Retrieving proxy info from IE settings Pin
ssudhaiyer19-Jan-04 1:36
ssudhaiyer19-Jan-04 1:36 
GeneralRe: Retrieving proxy info from IE settings Pin
haritadala19-Jan-04 2:54
haritadala19-Jan-04 2:54 
GeneralGetPixel() help needed Pin
__Cerb16-Jan-04 10:59
__Cerb16-Jan-04 10:59 
GeneralRe: GetPixel() help needed Pin
Jörgen Sigvardsson16-Jan-04 12:17
Jörgen Sigvardsson16-Jan-04 12:17 
GeneralRe: GetPixel() help needed Pin
__Cerb16-Jan-04 12:22
__Cerb16-Jan-04 12:22 
GeneralRe: GetPixel() help needed Pin
Jörgen Sigvardsson16-Jan-04 12:27
Jörgen Sigvardsson16-Jan-04 12:27 
GeneralRe: GetPixel() help needed Pin
__Cerb16-Jan-04 12:31
__Cerb16-Jan-04 12:31 
GeneralRe: GetPixel() help needed Pin
l a u r e n16-Jan-04 14:07
l a u r e n16-Jan-04 14:07 
GeneralRe: GetPixel() help needed Pin
__Cerb16-Jan-04 14:29
__Cerb16-Jan-04 14:29 

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.