은 내가 NameValueCollection.ToString
오버라이드 (override) 할 수있는 다음과 같은 확장 메서드를 작성했습니다 :재정 NameValueCollection은 ToString
public static string ToString(this NameValueCollection a)
{
return string.Join("&", a.AllKeys.Select(k => $"{k}={a[k]}"));
}
을하지만 여전히 기본 ToString
방법을 사용합니다.
나는 override
키워드를 추가하면 오류 얻을 :
'ToString(NameValueCollection)': no suitable method found to override
을 내가 new
키워드를 추가 할 때 그것은 new
키워드가 필요하지 않습니다 말한다 :
'ToString(NameValueCollection)' does not hide an inherited member. The new keyword is not required.
글쎄 기본 토 스트링 방법을 변경하고 싶었지만 이것이 유일한 방법 인 것 같습니다. 고마워. –