Files correlati : Ricompilazione Demo : [ ] Commento :aggiunti files discolatio alla 32 bit git-svn-id: svn://10.65.10.50/trunk@11035 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			43 lines
		
	
	
		
			885 B
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			885 B
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include "dlutils.h"
 | 
						|
                       
 | 
						|
void split_url(const TString& url, TString& site, TString& service)
 | 
						|
{
 | 
						|
  int slash_pos = 0, slash_found = 0;
 | 
						|
  for (int i = 0; url[i]; i++)  
 | 
						|
  {                          
 | 
						|
    if (url[i] == '/' || url[i] == '\\')
 | 
						|
    {            
 | 
						|
      if (slash_found == 0)
 | 
						|
        slash_pos = i;
 | 
						|
      slash_found++;
 | 
						|
    }
 | 
						|
    else
 | 
						|
    {
 | 
						|
      if (slash_found == 1)
 | 
						|
        break;
 | 
						|
      slash_found = slash_pos = 0; 
 | 
						|
    }
 | 
						|
  }
 | 
						|
  
 | 
						|
  if (slash_pos > 0)
 | 
						|
  {
 | 
						|
    site = url.left(slash_pos);
 | 
						|
    service = url.mid(slash_pos);
 | 
						|
  }
 | 
						|
  else
 | 
						|
  {
 | 
						|
    site = url;
 | 
						|
    service = "/";
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
void cifratura_laziale(const TString& usr, const TString& pwd, TString& key)
 | 
						|
{
 | 
						|
  TString16 str;
 | 
						|
  str.format("%-8s%-8s", (const char*)usr, (const char*)pwd);
 | 
						|
  key.cut(0);             
 | 
						|
  for (int i = 0; str[i]; i++)
 | 
						|
    key << char(str[i] + 2*(i+1));
 | 
						|
}
 | 
						|
 | 
						|
                       
 |