⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phone.c

📁 NETBIOS C程序源代码 用于网络通信
💻 C
字号:
/*============================================================*/
/*                         Phone.C                             */
/*============================================================*/

#include "netbios.h"
#include "predef.h"

/*------------------------------------------------------------*/
/*    Process All Event, Including Change User Name,          */
/*    Dailing, Respond Dailing, Phoning (key's Transfer)      */
/*------------------------------------------------------------*/
void  Process_Event()
	{
	BYTE CurKey;
	BOOL Done;
	BOOL Special;
	char StatusStr[80];

	Get_Status_Bar(StatusStr);
	Done=FALSE;
	Phone_Busy=FALSE;
	InBeDailed=FALSE;
	InDailing=FALSE;
	InPhoning=FALSE;
	PhoneSession=0xFF;
	While(!Done)
	    {
	    if(kbhit())
		{
		Get_Key(&Special,&CurKey);
		if(Special)
		    {
		    switch(CurKey)
			{
			case KEY_F1:
			    Change_Name();
			    Break;
			case KEY_F2:
			    if(!Phone_Busy)
				{
				Phone_Busy=TRUE;
				Phone_Process();
				Phone_Busy=FALSE;
				Refresh_Screen(StatusStr);
				}
			    else
				{
				Beep();
				}
			    Break;
			case ESCAPE:
			    Done=TRUE;
			    Break;
			default:
			    Beep();
			}
		    }
		else
		    {
		    Beep();
		    }
	        }
	    else				//No Key Entered...
		{
		if(!Phone_Busy && InBeDailed)
		    {
		    Phone_Busy+TRUE;
		    InBedailed=TRUE;
		    Responding();
		    InBedailed=FALSE;
		    if(PhoneSession!=0xFF)
			{
			InPhoning=TRUE;
			Phoning();
			strcpy(OtherName,"None");
			PhoneSession=0xFF;
			InPhoning=FALSE;
			}
		    else
			{
			Set_Status_Bar("Dailing or Responding Failed! Press Any Key...");
		        Beep();
			getch();
			}		    
	            Refresh_Screen(StatusStr);
		    Phone_Busy=FALSE;
		    }
		}
	    }
	DelName(SelfName);
	}
/*------------------------------------------------------------*/
void  Phone_Process()
	{
	char Buffer[40];
	char StatusStr[80];
	int  i;

	Get_Status_Bar(StatusStr);
	Set_Status_Bar("Please Enter The New User Name To Be Called...");

	for(i=17;i<=38;i++)
		{
		Put_Char(i,1,' ',INPUT_FCOLOR,INPUT_BCOLOR);
		}
	textcolor(INPUT_FCOLOR);
	textbackground(INPUT_BCOLOR);
	gotoxy(18,2);
	Buffer[0]=16;
	cgets(Buffer);
	memmove(&Buffer[0],&Buffer[2],strlen(&Buffer[2])+1);
	Beep();
	for(i=17;i<=38;i++)
	    {
	    Put_Char(i,1,' ',BLACK,BLACK);
	    }	
	gotoxy(1,1);

	if(EmptyStr(Buffer))
	    {
	    Set_Status_Bar("Empty Name are entered! Invalid! Press Any Key...");
	    getch();
	    }
	else
	    if(StrEqual(Buffer,SelfName))
		{
		Set_Status_Bar("Can't Call Yourself! Press Any Key ...");
		getch();
		}
	    else
		{
		InDailing=TRUE;
		Dialing(Buffer);
		InDailing=False;
		
	        if(PhoneSession!=0xFF)
		    {
		    InPhoning=TRUE;
		    Phoning();
		    strcpy(OtherName,"None");
		    PhoneSession=0xFF;
		    InPhoning=FALSE;
		    }
		else
		    {
		    Refresh_Screen("Dailing or Responding Failed! Press Any Key...");
		    Beep();
		    getch();
	            }		    
	        }
	Refresh_Screen(StatusStr);
	}
/*------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -