Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by JohnQK

  1. JohnQK

    parse the login name

    Salem. Thanks for you help on this issue. The problem is solved. The cause of the problem is related to the data type of passed-in login name. It is wide character. So I have to use wcstok not strtok. Thanks
  2. JohnQK

    parse the login name

    that is where my problem is. the login parameter is like "domain\user". So I have to change it to "domain\\user". I tried the following it is not working for (i=0; i<strlen(sLogin); i++){ if(sLogin[i] != char(92)&& bDomain == false ){ sDomain[i]=sLogin[i]; } else{ bDomain == true...
  3. JohnQK

    parse the login name

    Salem, Thanks for the reply. However, login info is entered in user interface no windows console, it is passed in as the parameter. when buff char array got it, it will be like "domain\user". If I changed you code based on this scenario, it will not work, #include <stdio.h> #include <string.h>...
  4. JohnQK

    parse the login name

    if the user type in "domain\username" in login page, the string passed in is "domain\username". The strtok can not parse this string correctly. That is why I need to add one more "\", but I do not know how to do it in the source code.
  5. JohnQK

    parse the login name

    I have login name like domain\username, I tried to use strtok to parse it. However, strtok can not recognize "\". For example, char ustring[] = "domain\username"; sLogin = strtok(ustring, "\\" ); sDomain = sLogin; while( sLogin != NULL ) { sUser = sLogin; sLogin = strtok( NULL, "\\" )...

Part and Inventory Search

Back
Top