首先用 Point p = new Point();然后分别定义它的p,X和p.Y,最后将它保存到StringBuilder中,显示为(1,1)(1,2);
问题是
List<Point> p = new List<Point>();
listpoint.Add(new Point(Convert.ToInt32(i ), Convert.ToInt32(j )));
sb.Append(p);结果显示的却是System.Collections.Generic.List`1[System.Drawing.Point],用List<>怎么才能显示成(1,2)的形式呢?求指导
问题是
List<Point> p = new List<Point>();
listpoint.Add(new Point(Convert.ToInt32(i ), Convert.ToInt32(j )));
sb.Append(p);结果显示的却是System.Collections.Generic.List`1[System.Drawing.Point],用List<>怎么才能显示成(1,2)的形式呢?求指导

解决方案
20
写法之一
foreach(var x in p.Select(t => "(" + t.X + "," + t.Y + ")")) { sb.Append(x); }