728x90
반응형
728x170
using System;
using System.Collections.Generic;
using System.Linq;
using StackExchange.Redis;
string serverAddress = "192.168.29.197:6379";
ConnectionMultiplexer multiplexer = ConnectionMultiplexer.Connect($"{serverAddress},allowAdmin=true");
IServer server = multiplexer.GetServer(serverAddress);
IGrouping<string, KeyValuePair<string, string>>[] groupingArray = server.Info();
for(int i = 0; i < groupingArray.Length; i++)
{
Console.WriteLine(groupingArray[i].Key);
foreach(KeyValuePair<string, string> keyValuePair in groupingArray[i])
{
Console.WriteLine("{0} -> {1}", keyValuePair.Key, keyValuePair.Value);
}
}
※ 패키지 설치 : StackExchange.Redis
1. 비주얼 스튜디오를 실행한다.
2. 비주얼 스튜디오에서 [도구] / [NuGet 패키지 관리자] / [패키지 관리자 콘솔] 메뉴를 클릭한다.
3. [패키지 관리자 콘솔]에서 아래 명령을 실행한다.
Install-Package StackExchange.Redis
728x90
반응형
그리드형(광고전용)
'C# > Redis' 카테고리의 다른 글
[C#/REDIS] ConnectionMultiplexer 클래스 : Connect 정적 메소드를 사용시 SSL 사용하기 (0) | 2020.11.14 |
---|---|
[C#/REDIS] ConnectionMultiplexer 클래스 : Connect 정적 메소드를 사용시 SSL 사용하기 (0) | 2020.11.14 |
[C#/REDIS] ConnectionMultiplexer 클래스 : Connect 정적 메소드를 사용시 관리자 모드 설정하기 (0) | 2020.11.14 |
[C#/REDIS] ConnectionMultiplexer 클래스 : Connect 정적 메소드를 사용시 관리자 모드 설정하기 (0) | 2020.11.14 |
[C#/REDIS] IServer 인터페이스 : ConfigGet 메소드를 사용해 서버 구성 구하기 (0) | 2020.11.14 |
[C#/REDIS] ITransaction 인터페이스 : Execute 메소드를 사용해 트랜잭션 처리하기 (0) | 2020.11.14 |
[C#/REDIS] IDatabase 인터페이스 : KeyExpire 메소드를 사용해 키 제한 시간 설정하기 (0) | 2020.11.14 |
[C#/REDIS] IRedisAsync 인터페이스 : Wait 메소드를 사용해 파이프라인 처리하기 (0) | 2020.11.14 |
[C#/REDIS] IDatabase 인터페이스 : KeyDelete 메소드를 사용해 키 제거하기 (0) | 2020.11.14 |
[C#/REDIS] IDatabase 인터페이스 : KeyRandom 메소드를 사용해 임의의 저장된 키 구하기 (0) | 2020.11.14 |
댓글을 달아 주세요