0
的Visual Basic 2010會自動更改我的代碼縮進從這個::如何防止visual studio搞亂我的代碼的身份?
public void fetchWebserviceCounters() {
csv = new StringBuilder();
try {
Category = new PerformanceCounterCategory("Web Service");
foreach (String instance in Category.GetInstanceNames()) {
counters = Category.GetCounters(instance);
foreach (PerformanceCounter counter in counters) {
if (counter.CounterName == "Total Bytes Sent" | counter.CounterName == "Total Bytes Recieved") {
csv.Append(counter.CounterName + ",");
csv.Append(counter.NextValue().ToString() + ", ");
}
}
}
}
catch (Exception e) {
Console.WriteLine(e.Message);
}
Console.Write(csv.ToString());
}
這個
public void fetchWebserviceCounters()
{
csv = new StringBuilder();
try
{
Category = new PerformanceCounterCategory("Web Service");
foreach (String instance in Category.GetInstanceNames())
{
counters = Category.GetCounters(instance);
foreach (PerformanceCounter counter in counters)
{
if (counter.CounterName == "Total Bytes Sent" | counter.CounterName == "Total Bytes Recieved")
{
csv.Append(counter.CounterName + ",");
csv.Append(counter.NextValue().ToString() + ", ");
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.Write(csv.ToString());
}
如何防止Visual Basic中,從這樣做是爲了我的代碼
其他:您將需要的東西在工具|選項|文本編輯器|語言|格式化|新行|大括號的新行選項。 – PVitt 2011-05-17 08:25:41