int main() { int cho; char check,c,esc; system("clear"); strcpy(filename,"pranav"); while(1) { system("clear"); printf(BOLDYELLOW"\n\n\n\n\n\t\t\t\t\t----------------------*******---------------------"RESET); printf(BOLDCYAN"\n\n\n\t\t\t\tHello !! Welcome to PRANAV's Library --- choose from the following menu"RESET); printf(YELLOW"\n\n\n\t\t\t\t\t1.Add Book Information"RESET); printf(YELLOW"\n\n\t\t\t\t\t2.Display Book Information"RESET); printf(YELLOW"\n\n\t\t\t\t\t3.Delete Book Information"RESET); printf(YELLOW"\n\n\t\t\t\t\t4.Search a Book "RESET); printf(YELLOW"\n\n\t\t\t\t\t5.Edit available book Information"RESET); printf(YELLOW"\n\n\t\t\t\t\t6.Exit from this menu"RESET); printf(BOLDYELLOW"\n\n\n\n\n\t\t\t\t\t----------------------*******---------------------"RESET); printf(BOLDCYAN"\n\n\t\t\t\t\t\t Your Choice:"RESET); scanf("%d",&cho); switch(cho) { case 1: Password(); addbook(); break; case 2: display_book(lib); sleep(2); break; case 3: Password(); delete_book(lib); sleep(2); break; case 4: search(lib); sleep(2); break; case 5: Password(); edit_info(lib); break; case 6: exitp(); default: printf(BOLDRED"\n\t\t\t\tChoose from following choices only \n"RESET); printf(RED"\t\t\tEnter 1 2 3 4 5 6 7"RESET); } } }
//AC.template.verifiedRecord void MainWidget::init_word() { QAxWidget word("Word.Application"); word.setProperty("Visible", false);//隐式的打开一个word应用程序 QAxObject * documents = word.querySubObject("Documents"); //获取所有工作文档 documents->dynamicCall("Add (void)");//创建一个word文档 QAxObject * document = word.querySubObject("ActiveDocument"); //获取当前激活的文档 QAxObject *selection = word.querySubObject("Selection"); //写入文件内容 QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 QString str = time.toString("yyyy-MM-dd hh:mm:ss ddd"); //设置显示格式 selection->dynamicCall("TypeText(const QString&)","hello"+str); //设置保存 QVariant newFileName("e:/test.doc"); //存放位置和名称 QVariant fileFormat(1); //文件格式 QVariant LockComments(false); QVariant Password(""); //设置打开密码 QVariant recent(true); QVariant writePassword(""); QVariant ReadOnlyRecommended(false); document->querySubObject("SaveAs(const QVariant&, const QVariant&,const QVariant&, const QVariant&, const QVariant&, const QVariant&,const QVariant&)", newFileName, fileFormat, LockComments, Password, recent, writePassword, ReadOnlyRecommended); document->dynamicCall("Close (boolean)", true); //关闭文档 word.dynamicCall("Quit (void)");//退出 }
void BPasswordKey::PrintToStream() { printf("password key:\n"); BKey::PrintToStream(); printf("\tpassword: \"%s\"\n", Password()); }
util::Error LookupOwner(const std::string& user, const std::string& group, fs::Owner& owner) { auto dbConfig = config->Database(); try { mongo::DBClientConnection conn; conn.connect(dbConfig.Host()); if (!dbConfig.Login().empty()) { std::string errmsg; if (!conn.auth(dbConfig.Name(), dbConfig.Login(), dbConfig.Password(), errmsg)) throw mongo::DBException("Authentication failed", 0); } owner = fs::Owner(user.empty() ? -1 : LookupUID(conn, user), group.empty() ? -1 : LookupGID(conn, group)); } catch (const mongo::DBException& e) { return util::Error::Failure(e.what()); } catch (const util::RuntimeError& e) { return util::Error::Failure(e.Message()); } return util::Error::Success(); }
QNetworkReply* Tracker::AuthPostJson( const QString& path, const QByteArray& data ) { #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) QString credentials = "Basic " + ( Username() + ":" + Password() ).toLatin1().toBase64(); #else QString credentials = "Basic " + ( Username() + ":" + Password() ).toAscii().toBase64(); #endif QNetworkRequest request = CreateTrackerRequest( path ); #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) request.setRawHeader( "Authorization", credentials.toLatin1() ); #else request.setRawHeader( "Authorization", credentials.toAscii() ); #endif request.setHeader( QNetworkRequest::ContentTypeHeader, "application/json" ); return mNetworkManager.post( request, data ); }
InputClient::InputClient(ClientIO *clio, char const *passwd) : mClio(clio), mEnabled(false) { mInit=B_OK; if(!Password(mClio).SendPassword(passwd)) mInit=B_ERROR; }
DatabaseTagTestFixtureClass() : DatabaseTestFixtureClass("database_tag") , DatabaseTag() { DatabaseTag.Schema = UNICODE_STRING_SIMPLE("database_tag"); DatabaseTag.Host = UNICODE_STRING_SIMPLE("127.0.0.1"); DatabaseTag.User = t4p::CharToIcu(UserName().c_str()); DatabaseTag.Password = t4p::CharToIcu(Password().c_str()); }
static void GetPassword( void ) { char buff[80]; buff[0] = '\0'; Password( "What ees da passwurd?", buff, 80 ); Say( buff ); }
// Login information void _Server::HandleLoginInfo(_Buffer &Data, _Peer *Peer) { // Read packet bool CreateAccount = Data.ReadBit(); std::string Username(Data.ReadString()); std::string Password(Data.ReadString()); uint64_t Secret = Data.Read<uint64_t>(); Username.resize(std::min(ACCOUNT_MAX_USERNAME_SIZE, Username.length())); Password.resize(std::min(ACCOUNT_MAX_PASSWORD_SIZE, Password.length())); // Validate singleplayer if(!Username.length() && !Password.length() && Secret != Save->GetSecret()) return; // Create account or login if(CreateAccount) { // Check for existing account if(Save->CheckUsername(Username)) { _Buffer Packet; Packet.Write<PacketType>(PacketType::ACCOUNT_EXISTS); Network->SendPacket(Packet, Peer); return; } else Save->CreateAccount(Username, Password); } // Get account id Peer->AccountID = Save->GetAccountID(Username, Password); // Make sure account exists _Buffer Packet; if(Peer->AccountID == 0) { Packet.Write<PacketType>(PacketType::ACCOUNT_NOTFOUND); } else { bool AccountInUse = false; for(auto &CheckPeer : Network->GetPeers()) { if(CheckPeer != Peer && CheckPeer->AccountID == Peer->AccountID) { AccountInUse = true; Peer->AccountID = 0; break; } } if(AccountInUse) Packet.Write<PacketType>(PacketType::ACCOUNT_INUSE); else Packet.Write<PacketType>(PacketType::ACCOUNT_SUCCESS); } Network->SendPacket(Packet, Peer); }
bool PerformLoginProcedure(const string &email, const string &licencekey, const string &password, bool testOverride) { // Wait for acknowledge from server (in the form of a protocol command) auto beginTime = glfwGetTime(); if (gMode.Get() != GameMode::LOGIN) { auto &ss = View::gErrorManager.GetStream(true, false); ss << "Login in wrong state " << gMode.Get(); return false; } LoginMessage(testOverride ? "test0" : email.c_str()); gMode.Set(GameMode::PASSWORD); while (gMode.Get() != GameMode::GAME) { glfwSleep(0.01); // Avoid a busy wait ListenForServerMessages(); // Wait for automatic login without password switch (gMode.Get()) { case GameMode::PASSWORD: case GameMode::WAIT_ACK: continue; // Nothing to do yet. case GameMode::REQ_PASSWD: // printf("Parse: mode GameMode::REQ_PASSWD, %d chall bytes\n", gLoginChallengeLength); Password(password.c_str(), licencekey.c_str()); gMode.Set(GameMode::WAIT_ACK); // printf("loginDialog::UpdateDialog: Mode GameMode::WAIT_ACK\n"); continue; case GameMode::LOGIN_FAILED: { auto &ss = View::gErrorManager.GetStream(true, false); ss << "Login failed"; return false; } case GameMode::ESC: exit(1); case GameMode::GAME: break; // Now we are done! case GameMode::TELEPORT: case GameMode::CONSTRUCT: case GameMode::INIT: case GameMode::LOGIN: case GameMode::EXIT: std::cerr << "PerformLoginProcedure Unexpected mode" << gMode.Get(); exit(1); } } double connectionDelay = glfwGetTime() - beginTime; if (connectionDelay > 0.5 && gDebugOpenGL) printf("PerformLoginProcedure connection delay %f\n", connectionDelay); unsigned char b[] = { 0x03, 0x00, CMD_GET_COORDINATE }; // GET_COORDINATE SendMsg(b, sizeof b); View::gSoundControl.RequestMusicMode(View::SoundControl::SMusicModeTourist); return true; }
MysqlResourceFinderFixtureClass() : DatabaseTestFixtureClass("sql_resource_finder") , SqliteTestFixtureClass(t4p::ResourceSqlSchemaAsset()) , DatabaseTag() , Fetcher(SqliteTestFixtureClass::Session) , Finder(SqliteTestFixtureClass::Session) { DatabaseTag.Driver = t4p::DatabaseTagClass::MYSQL; DatabaseTag.Schema = UNICODE_STRING_SIMPLE("sql_resource_finder"); // user name, pwd are #defines come from the premake script premake_opts.lua DatabaseTag.Host = UNICODE_STRING_SIMPLE("127.0.0.1"); DatabaseTag.User = t4p::CharToIcu(UserName().c_str()); DatabaseTag.Password = t4p::CharToIcu(Password().c_str()); }
// --------------------------------------------------------- // RFavouritesSrvTable::ReadItemDataL // --------------------------------------------------------- // void RFavouritesSrvTable::ReadItemDataL( CFavouritesItemImpl& aItem ) const { // Fill standard attributes. aItem.SetUid( Uid() ); // No bookmark can exist with the Null Uid. __ASSERT_DEBUG( aItem.Uid() != KFavouritesNullUid, FavouritesPanic( EFavouritesNullUidInDatabase ) ); aItem.SetParentFolder( ParentFolder() ); aItem.SetType( Type() ); aItem.SetNameL( Name() ); HBufC* url = UrlLC(); aItem.SetUrlL( *url ); CleanupStack::PopAndDestroy(); // url aItem.SetUserNameL( Username() ); aItem.SetPasswordL( Password() ); aItem.SetWapAp( WapAp() ); aItem.SetFactoryItem( FactoryItem() ); aItem.SetReadOnly( ReadOnly() ); aItem.SetContextId( ContextId() ); aItem.SetModified( Modified() ); aItem.SetHidden( Hidden() ); }
void main(void) { int Proceed; int driver=VGA,mode=VGAHI; //detect best driver and mode initgraph(&driver,&mode,"c:\\tc\\bgi"); //initialize graphics mode randomize(); do { Proceed = Password(); // CHECK THE PASSWORD } while ( Proceed!=1); cleardevice(); start(); // AND THEM CHECK menu(); getch(); // THE VALUE RETURNED... closegraph(); }
* modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <menu.h> Password password = Password("1000"); char menu_buffer[16] = ""; const char sel_item[] PROGMEM = "> "; const char unsel_item[] PROGMEM = " "; const char active_mark[] PROGMEM = " *"; const char space[] PROGMEM = " "; const char ok[] PROGMEM = "OK"; const char strRecording[] PROGMEM = "Gravando..."; const char strBusy[] PROGMEM = "Disp. ocupado"; const char strBack[] PROGMEM = "Tras"; const char strFront[] PROGMEM = "Frente"; const char strLeft[] PROGMEM = "Esquerda";
on, // system is running detection, // movement detected before_sirene,// delay before sirene (delai d'entrée dans maison) ring_sirene // sirene is ringing }; // --- variables --- type_alarmState alarmState = off; type_alarmState next_alarmState = alarmState; uint8_t printPositionPIN = 0; boolean passCorrect = false; boolean sensorDetection = false; Metro wait_on_timer = Metro(wait_on_delay); Metro before_sirene_timer = Metro(before_sirene_delay); Metro ring_sirene_timer = Metro(ring_sirene_delay); Password pwd = Password("123"); // définition du mot de passe // --- setup Keypad --- char keys[ROWS][COLS] = // { // {'1','2','3','A'}, // {'4','5','6','B'}, // configuration {'7','8','9','C'}, // du clavier {'*','0','#','D'} // }; // byte rowPins[ROWS] = {9, 8, 7, 6}; // byte colPins[COLS] = {5, 4, 3, 2}; // Keypad kpd = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS); // // --- setup LCD ---
RSACryptor(char * parol,int len) { hProv=NULL; Password(parol,len); }
int main(int argc, char *argv[]) { int sockfd; struct sockaddr_in server_addr; struct hostent *host; struct chat temp; char cmd[MAX]; int login = 0; int admin; pthread_t tid; time_t timep; char tm[MAX]; if (argc != 2) { printf("Error! The Correct Format is\n./client 127.0.0.1\n"); exit(1); } if (NULL == (host = gethostbyname(argv[1]))) { printf("Error! gethostbyname failure!\n"); exit(1); } if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { printf("Error! socket failure!\n"); exit(1); } server_addr.sin_family = AF_INET; server_addr.sin_port = htons(PORT); server_addr.sin_addr = *((struct in_addr *)host->h_addr); if (connect(sockfd, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) < 0) { printf("Error! connect failure!\n"); exit(1); } Start(); memset(&temp, 0, sizeof(struct chat)); while (!login) { admin = 0; printf("\033[13;42H\033[38X"); printf("\033[13;50H 请输入相应的命令:"); My_Fgets(cmd, MAX, stdin); temp.cmd = Analy_Start_Cmd(cmd); switch (temp.cmd) { case REG: { Reg(sockfd, &temp); sleep(3); printf("\033[12;42H\033[38X"); break; } case LOG: { Log(sockfd, &temp); if (0 == strcmp(temp.name, "admin")) { admin++; } memset(&temp, 0, sizeof(struct chat)); temp.revert = -999; read(sockfd, &temp, sizeof(struct chat)); printf("\033[11;42H\033[38X"); if (PASSWORDOK == temp.revert) { admin++; printf("\033[11;47H 您已经登录成功,欢迎您的使用!\n"); login = 1; } else if (PASSWORDNO == temp.revert) { printf("\033[11;50H\033[41m 密码错误或用户名不存在!\033[0m\n"); } else if (ONLINEIN == temp.revert) { printf("\033[11;52H\033[41m 该用户已经登录!\033[0m\n"); } else { printf("\033[11;50H\033[41m 接受到错误的服务器消息!\033[0m\n"); } break; } case USERHELP: { printf("\033[13;42H\033[38X"); printf("\033[13;48H\033[43mCopyright @ 2015-2016, Shen \033[0m\n"); printf("\033[14;53H\033[43mAll Rights Reserve\033[0m\n"); sleep(3); printf("\033[14;42H\033[38X"); break; } case USEREXIT: { system("reset"); exit(0); } default: { printf("\033[13;42H\033[38X"); printf("\033[13;53H\033[41m您输入的命令有误!\033[0m\n"); sleep(2); } } } if (2 == admin) { Admin_Start(temp.name); } else { Client_Start(temp.name); } pthread_create(&tid, NULL, Thread_Read,(void *)&sockfd); while (1) { Check_Screen(); time(&timep); strcpy(tm, ctime(&timep)); tm[strlen(tm) - 1] = '\0'; printf("\033[27;2H\033[100X\033[1A\033[100X\033[1A\033[100X\033[1A\033[100X"); fflush(stdout); My_Fgets(cmd, MAX, stdin); printf("\033[24;2H\033[100X"); fflush(stdout); if (2 == admin) { temp.cmd = Analy_Admin_Cmd(cmd); } else { temp.cmd = Analy_Client_Cmd(cmd); } strcpy(temp.time, tm); switch (temp.cmd) { case CHAT: { Chat_One(sockfd, &temp); sleep(1); break; } case ALL: { Chat_All(sockfd, &temp); sleep(1); break; } case SEE: { Handle_See_Board(); See(sockfd, &temp); sleep(3); break; } case DATA: { char ch[MAX] = "no"; printf("\033[1;1H\033[J"); fflush(stdout); Data(sockfd, &temp); sleep(3); printf("Please input yes\n"); while (0 != strcmp(ch, "yes")) { My_Fgets(ch, MAX, stdin); } if (2 == admin) { Admin_Start(temp.name); } else { Client_Start(temp.name); } sleep(2); break; } case FACE: { Face(sockfd, &temp); sleep(1); break; } case HI: { Hi(sockfd, &temp); sleep(1); break; } case PASSWORD: { Password(sockfd, &temp); sleep(3); break; } case TRANS: { Trans(sockfd, &temp); sleep(5); break; } case CHANGE: { Change(sockfd, &temp); sleep(1); break; } case KICK: { Kick(sockfd, &temp); sleep(1); break; } case SHUT: { Shut(sockfd, &temp); sleep(1); break; } case REMOVE: { Remove(sockfd, &temp); sleep(1); break; } case CANCEL: { Cancel(sockfd, &temp); sleep(1); break; } case HELP: { if (2 == admin) { Admin_Start(temp.name); } else { Client_Start(temp.name); } sleep(1); break; } case EXIT: { Exit_Tell(sockfd, &temp); sleep(1); system("reset"); exit(0); } default: { printf(" 您输入的命令有误!\n"); sleep(1); break; } } } close(sockfd); return 0; }
int main() { Password(); return 0; }
void Password(void) //for password option { system("cls"); gotoxy(25,2); printf("<<<<<LIBRARY MANGEMENT SYSTEM>>>>>"); char ch,pass[50]; int i=0,j; gotoxy(15,4); printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); gotoxy(28,6); printf("Enter PASSWORD to log in"); gotoxy(15,5);printf("\xB2");gotoxy(15,6);printf("\xB2");gotoxy(15,7);printf("\xB2");gotoxy(15,8);printf("\xB2");gotoxy(15,9);printf("\xB2");gotoxy(15,10);printf("\xB2");gotoxy(15,11);printf("\xB2");gotoxy(15,12);printf("\xB2"); gotoxy(15,13);printf("\xB2");gotoxy(15,14);printf("\xB2");gotoxy(15,15);printf("\xB2");gotoxy(15,16);printf("\xB2");gotoxy(15,17);printf("\xB2");gotoxy(15,18);printf("\xB2");gotoxy(15,19);printf("\xB2");gotoxy(15,20);printf("\xB2"); gotoxy(68,5);printf("\xB2");gotoxy(68,6);printf("\xB2");gotoxy(68,7);printf("\xB2");gotoxy(68,8);printf("\xB2");gotoxy(68,9);printf("\xB2");gotoxy(68,10);printf("\xB2");gotoxy(68,11);printf("\xB2");gotoxy(68,12);printf("\xB2"); gotoxy(68,13);printf("\xB2");gotoxy(68,14);printf("\xB2");gotoxy(68,15);printf("\xB2");gotoxy(68,16);printf("\xB2");gotoxy(68,17);printf("\xB2");gotoxy(68,18);printf("\xB2");gotoxy(68,19);printf("\xB2");gotoxy(68,20);printf("\xB2"); gotoxy(15,20); printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); gotoxy(20,8); printf("Enter Password:"******"password.txt","r"); char passFile[50]; if(fread(&passFile,sizeof(passFile),1,z)==1) ; printf("\n"); if(strcmp(pass,passFile)==0) { gotoxy(25,11); //textcolor(BLINK); printf("Password match"); gotoxy(25,13); printf("Press any key to countinue....."); getch(); menu(); } else { gotoxy(25,13); printf("\aWarning!! Incorrect Password"); getch(); rewind(z); Password(); } }
const string& GetPassword(void) const { return Password(); }
void nsHTTPAuthInformation::SetToHttpAuthIdentity(uint32_t authFlags, nsHttpAuthIdentity& identity) { identity.Set(Domain().get(), User().get(), Password().get()); }
#include <Password.h> Password password = Password( "1234" ); void setup() { Serial.begin(9600); <Password.h>.append('1');//add 1 to the guessed password <Password.h>.append('2');//add 2 to the guessed password <Password.h>.append('3');//add 3 to the guessed password <Password.h>.append('4');//add 4 to the guessed password //should print true, since 1234 == 1234 Serial.println( <Password.h>.evaluate()?"true":"false" ); <Password.h>.reset(); //reset the guessed password to NULL //should print false, since 1234 != NULL Serial.println( <Password.h>.evaluate()?"true":"false" ); <Password.h>.set("qwerty"); //set target password to qwerty //should print true, since qwerty == qwerty Serial.println( <Password.h>.is("qwerty")?"true":"false" ); //should print false, since qwerty != qwirty Serial.println( password.is("qwirty")?"true":"false" ); } void loop() { /*nothing to loop*/ }