|
Hi,
try to run this program from the windows command prompt..
|
|
|
|
|
We have an application developed using MFC in Visual Studio 6.0. which is a client-server based architecture using TCP/IP Sockets.
The server application reads data from text files and binary (which acts as database). Based on the Network configuration, the client application that runs in various stations (PCs connected within the LAN Network) connects to the Server application. Exchange of data then takes place between the server and various number of clients that are connected to the server. All the communication happens using the TCP/IP socket protocol.
Now there is a requirement to convert the existing architecture to web based architechture such that the Server is installed in a remote PC. The clients from various geographical locations have to be connected to the Server.
Please provide me guidelines how to convert the existing architecture to web based architecture.
|
|
|
|
|
You need to convert your server into a web server using one of the web architectures available. If you are familiar with Microsoft products then ASP.NET[^] would be a good choice.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi,
First you need to convert your Server portion to a web architecture.You can use ASP.Net and SQL Server. Then develop the client in Visual c++ or something else, the client must communicate to the database.
|
|
|
|
|
"How to change my app from using Internet Protocol, to an Internet based one"
Er, anyone else see a problem here?
manoharbalu wrote: Now there is a requirement to convert the existing architecture to web based
architechture
So you can market it as 'Cloud' no doubt?
Just leave it as it is, it is already an internet based app and slap 'Cloud' on the box to fool the muppets and marketing types who use words without understanding what they mean.
==============================
Nothing to say.
|
|
|
|
|
The internet is based on TCP so at the basic level there is no difference.
The two factors that are relevant.
1. You must have a public IP. On a lan you probably have a private one. The public IP allows someone on the internet to address you. You might, but it is not required, also want to have a Domain Name. There will probably also need to be seem network infrastructure setup to route from the public facing hardware to the actual server. None of this has anything to do with the existing server/client code unless the client code does not allow a way to specify an IP/Domain Name (because someone hardcoded the IP.)
2. You MUST provide security. User/pwd should be sufficient as long as the pwd strength is sufficient. You might already have that in the code but if not it must be added.
Besides the above you might want to investigate SSL depending on the nature of the data that gets sent.
|
|
|
|
|
i have a string
login#user#1 username password
i want to trim login# and extract user#1 username password
i am unable to sole it using strtok
please help
|
|
|
|
|
Use
std::string::find_first_of() To find the position of
#. Then use
std::string::substring() to extract the string you required.
Code might look like this:
std::string test = login#user#1 username password;
size_t pos = test.find_first_of("#");
std::string requiredstr = test.substr(pos+1);
|
|
|
|
|
is there any way to do it using strchr
|
|
|
|
|
|
hey i am programming in C...can u give a sample code of how to do it using strchr(), strtok or any other function in C
|
|
|
|
|
|
yeah i know this but this does not work for the string
Login#User#1 username password if want to trim Login# and extract User#1 username password
|
|
|
|
|
You should be able to figure out what changes to the program needs to be made for it to work with your string.
|
|
|
|
|
I've provided you a link with source code. Use the formula
in the printf statement inside the while loop.
char str[] = "Your string goes here";
char * pch;
printf ("Looking for the '#' character in \"%s\"...\n",str);
pch=strchr(str,'s');
while (pch!=NULL)
{
printf ("found at %d\n",pch-str+1);
pch=strchr(pch+1,'s');
}
pch is the required string.
|
|
|
|
|
Use strchr() to find the first # character, and then you can use strtok() to split into the three tokens delimited by spaces.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
After so many questions regarding strings, parsing and related stuff, don't you think it's about time to read some actual books or articles to learn all this? Or do you intend to keep asking for the rest of your life?
Seriously, the time you keep spending on low level programming questions like this would have been better spent by reading up and learning something by yourself. You are doing yourself and everyone else a disservice by asking questions without ever even trying to look something up and really understand the things you are dealing with.
Regarding this particular question, simply reading up on strtok would solve it, easily.
|
|
|
|
|
Have you tried something like:
char *pszSource = "login#user#1 username password";
char *pszPos = strstr(pszSource, "user#1");
int nLen = pszSource - pszPos;
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I get these compile errors "warning C4129: 'N' character escape sequence.
I think I just did something dumb, because I have other lines that are fine in the same code block. I'm not really sure what to make of it.
L" /SAPWD=\"securePassword1\";"
but this line errors on \"N
L" /AGTSVCACCOUNT=\"NT_AUTHORITY\NETWORK SERVICE\""
WCHAR *szParameters =
L" /Q /IACCEPTSQLSERVERLICENSETERMS"
L" /ACTION=install"
L" /ERRORREPORTING=1"
L" /INDICATEPROGRESS"
L" /FEATURES=SQL,FULLTEXT,AS,RS,IS,TOOLS"
L" /INSTANCENAME=SQLExpress"
L" /SECURITYMODE=SQL"
L" /SAPWD=\"securePassword1\";"
L" /NPENABLED=1"
L" /TCPENABLED=1"
L" /BROWSERSVCSTARTUPTYPE=AUTOMATIC"
L" /SQLSVCSTARTUPTYPE=AUTOMATIC"
L" /AGTSVCSTARTUPTYPE=AUTOMATIC"
L" /RSSVCStartupType=Automatic"
L" /AGTSVCACCOUNT=\"NT_AUTHORITY\NETWORK SERVICE\""
L" /SQLSYSADMINACCOUNTS=\"BUILTIN\ADMINISTRATORS\""
L" /SQLSVCACCOUNT=\"NT AUTHORITY\NETWORK SERVICE\""
L" /FTSVCACCOUNT=\"NT AUTHORITY\NETWORK SERVICE\""
L" /RSSVCACCOUNT=\"NT AUTHORITY\NETWORK SERVICE\""
L" /RSSVCPASSWORD=\"securePassword1\" "
L" /ISSVCACCOUNT=\"NT AUTHORITY\NETWORK SERVICE\""
L" /ISSVCPASSWORD=\"securePassword1\"";
return szParameters;
|
|
|
|
|
|
You have to escape the backslashes in the middle of the string, like this:
L" /AGTSVCACCOUNT=\"NT_AUTHORITY\\NETWORK SERVICE\""
|
|
|
|
|
I get it now, I escaped out the doublequote, but I didn't bother to look in the center. I was too busy looking at the doublequote.
It was a dumb mistake, Thanks for your help.
|
|
|
|
|
Dear All,
The code below is C Programming that i wrote and is working but I am having problem in reading any records I am saving into text File called "MY FILE".Also anytime to ADD NEW RECORD in my switch case selection,the initial record that was in the is been deleted automatically.Did any one know what is wrong.I can figure it out,i have been tried debugging but all to no avail.I will appreciate your ideas.Thanks
***********************************************************'''''****
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 10
#define Income_type 8
#define Expense_type 7
typedef struct{
int day;
int month;
int year;
}Date_of_transaction;
typedef struct{
int type_transaction;
char desc_transaction[80];
float amount_of_money;
Date_of_transaction date;
}Trecord;
typedef struct{
Trecord r;
}Tarray;
int count(int *count);
void add_new_record(Trecord records,Tarray t[],int *counter,int *count);
void read_data_from_disc(Trecord *records);
void save_curiculum_to_disc(Tarray records[]);
void add_money(Trecord *records);
void spend_money(Trecord *records);
void print_a_report(Tarray *records,int *counter);
void delete_a_record(Trecord *record);
void initialize(Trecord records);
void initializeRecord(Tarray records[]);
int main(int argc, char** argv) {
int quit = 0;
int choice = 0;
static int counter = 0;
int count = -1;
Trecord records;
Tarray recordData[SIZE];
initializeRecord(recordData);
while(!quit) {
printf("\nChoose an option:\n"
"1. Add New Record\n"
"2. Read Data from File\n"
"3. Save Data to File\n"
"4. Print Report\n"
"5. Quit\n" );
scanf("%d", &choice);
switch(choice){
case 1:
count++;
add_new_record(records,recordData,&counter,&count);
printf("%d",count);
break;
case 2:
read_data_from_disc(&records);
break;
case 3:
save_curiculum_to_disc(recordData);
break;
case 4:
count++;
print_a_report(recordData,&count);
break;
case 5:
quit = 1;
break;
default:
printf("Invalid Selection\n");
}
}
return (EXIT_SUCCESS);
}
void initializeRecord(Tarray records[]){
int i;
for(i=0;i
modified 26-Nov-11 12:57pm.
|
|
|
|
|
Please wrap your code using <pre> and </pre> tags... this is painful to look at.
|
|
|
|
|
idbee2k3 wrote: ...is working but I am having problem...
That appears to be contradictory. It's either working or it isn't.
idbee2k3 wrote: Did any one know what is wrong.
Hard to tell since you've not shown any code that reads or writes. The only thing you've shown is menu code which is completely irrelevant to the problem.
Use the debugger to narrow the problem down to just a handful of lines, then come back and post those.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|