Port 개체등록 및 가져오기 방법 예제
2021. 8. 20. 15:10ㆍ프로그래밍
반응형
Port 개체등록 및 가져오기 방법 예제 입니다.
그냥 구조만 참조하세요.
public bool AddPort(int intPortID)
{
clsPort dclsPort; //Port 개체 선언
try
{
int dintPortID = intPortID;
if (dintPortID <= 0)
{
return false;
}
else
{
if (HashPort.Contains(dintPortID))
{
return true;
}
else
{
dclsPort = new clsPort(dintPortID);
HashPort.Add(dintPortID, dclsPort);
return true;
}
}
}
catch
{
return false;
}
finally
{
}
}
public clsPort Port(int intPortID)
{
try
{
int dintPortID = intPortID;
if (HashPort.Contains(dintPortID))
{
return (clsPort)HashPort[dintPortID];
}
else
{
return null;
}
}
catch
{
return null;
}
finally
{
}
}
public ICollection Port()
{
try
{
return HashPort.Keys;
}
catch
{
return null;
}
finally
{
}
}
public int PortCount
{
get { return HashPort.Count; }
}
반응형
'프로그래밍' 카테고리의 다른 글
C# FtpMediaControl을 위한 예제 소스 (0) | 2021.08.31 |
---|---|
[FormatPhoneNumber] 전화번호 포멧 변경 함수 (0) | 2021.08.24 |
C# 프린터 관련 잡다한 메소드 (1) | 2021.08.16 |
C# SECS 메세지를 XML 구조로 저장및 읽기 예제 (1) | 2021.08.10 |
C# SECS 타임아웃 처리를 위한 델리게이터 예제 (1) | 2021.08.10 |