首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

看到好多人不会贴代码,贴的代码没有缩进,很乱,不易阅读,现向大家讲一下怎么贴代码,例如贴C#代码

2012-04-13 
看到好多人不会贴代码,贴的代码没有缩进,很乱,不易阅读,现向大家讲一下如何贴代码,例如贴C#代码:1\看到好

看到好多人不会贴代码,贴的代码没有缩进,很乱,不易阅读,现向大家讲一下如何贴代码,例如贴C#代码:
1\看到好多人不会贴代码,贴的代码没有缩进,很乱,不易阅读,现向大家讲一下如何贴代码,例如贴C#代码: 
 
2、在发贴的文本框上方单击“#”按钮,选择 C#
3、将要发的代码粘贴到【code=C#】和【/code】之间,这样发出来的代码就会像下面一样:

C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}


[解决办法]
代码应当对齐:
C# code
public class Test {    public static void Main(String[] args)      {       Test t = new Test();    }}
[解决办法]
C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}
[解决办法]
C# code
public class Hello{     public static void Main(String[] args){Cosole.Write(Hello);}}
[解决办法]
C# code
public class student{  private string name;    public student(string_name)     {       this.name=_name;     }}
[解决办法]
应该这样!
C# code
public class student{  private string name;    public student(string_name)     {       this.name=_name;     }}
[解决办法]
C# code
public class Hello{     public static void Main(String[] args){Cosole.Write(Hello);}}
[解决办法]
C# code
public class Hello{     public static void Main(String[] args){Cosole.Write(Hello);}}
[解决办法]
C# code
public class Hello{     public static void Main(String[] args){Cosole.Write(Hello);}}
[解决办法]
C# code
var a = window.showModalDialog("aa.aspx"); alert(a); 在aa.aspx中,做完操作后. window.returnValue = 123; window.close(); 那么父窗口中的a就是123
[解决办法]
C# code
class ProgrammBase    {        public class Programm        {            public string ProgrammId { get; set;}            public string KontrollArtId { get; set; }            public int Stichprobe { get; set; }            public Programm(string programmId, string kontrollArtId, int stichprobe)            {                ProgrammId = programmId;                KontrollArtId = kontrollArtId;                Stichprobe = stichprobe;            }            public static IList<Programm> ProgrammList { get; set; }        }}
[解决办法]
JScript code
function recommendCallback(recommends) {    if (!recommends || recommends.length < 0) return;    var j = Math.floor(recommends.length * Math.random());    updateReplyItems();    if (reply_items.length <= 0) return;    var start = reply_items[0].replyId ? 0 : 1;    var end = start + Math.min(recommends.length, Math.min(5, reply_items.length));    for (var i = start; i < end; i++) {        if (reply_items[i] && reply_items[i].recommend) {            j = (j + 1) % recommends.length;            var html = new Array();            html.push("精华推荐:");            html.push("<a href=\"");            html.push(recommends[j].url);            html.push("\" target=\"_blank\" onclick='LogClickCount(this,112);'>");            html.push(recommends[j].title);            html.push("</a>");            reply_items[i].recommend.innerHTML = html.join("");        }    }} 


[解决办法]

C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}
[解决办法]
C# code
 public class Test        {            public static void Main(String[] args)            {                Test t = new Test();            }        }
[解决办法]
C# code
public class Test        {            public static void Main(String[] args)            {                Test t = new Test();            }        }
[解决办法]
C# code
public void HelloWord(){Console.write("原来是这样的");}
[解决办法]
C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}
[解决办法]
C# code
public class Test        {            public static void Main(String[] args)            {                Console.WriteLine("原来如此");               }        }
[解决办法]
C# code
public class Test        {            public static void Main(String[] args)            {                Console.WriteLine("原来如此");               }        }
[解决办法]
C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}
[解决办法]
C# code
 private void CloseWindow_Click(object sender, EventArgs e)        {             this.Hide();        }
[解决办法]
C# code
public class student{  private string name;    public student(string_name)     {       this.name=_name;     }}[align=left][/align]hoho
[解决办法]
C# code
   private void CloseWindow_Click(object sender, EventArgs e)        {             this.Hide();        }
[解决办法]
C# code
public void CreatAccessDB()        {            string dbName = "D:\\" + DateTime.Now.Year.ToString() + ".mdb";            ADOX.CatalogClass cat = new ADOX.CatalogClass();            cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbName + ";Jet OLEDB:Engine Type=5");                        cat = null;        }
[解决办法]
C# code
void main(String[] args){    Console.WriteLine("1\看到好多人不会贴代码,贴的代码没有缩进,很乱,不易阅读,现向大家讲一下如何贴代码,例如贴C#代码:");    Console.WriteLine("2、在发贴的文本框上方单击“#”按钮,选择 C#");    Console.WriteLine("3、将要发的代码粘贴到【code=C#】和【/code】之间,这样发出来的代码就会像下面一样: ");}
[解决办法]
C# code
public class Test {        public static void Main(String[] args)    {       Test t = new Test();  }}
------解决方案--------------------


C# code
   public static void Main()        {            App app = new App();            app.Run();        }
[解决办法]
试试。
C# code
public class Test {    public static void Main(String[] args)      {       Test t = new Test();    }}
[解决办法]
C# code
public class Test {public static void Main(String[] args)  { Test t = new Test();}}
[解决办法]
C# code
public class Test {    public static void Main(String[] args)      {       Test t = new Test();    }}
[解决办法]
C# code
public class student{  private string name;    public student(string_name)     {       this.name=_name;     }}
[解决办法]
C# code
        /// <summary>        /// 整数判断        /// </summary>        /// <param name="num">整数类型参数</param>        /// <returns>是否为整数</returns>        public static bool IsNum(string num)        {            Regex numRegex = new Regex(@"^[-]?\d*$");//(@"\s*(\-)?\d*\s*");            return numRegex.IsMatch(num);        } 

热点排行