📄 form1.cs
字号:
this.splitter2.TabIndex = 9;
this.splitter2.TabStop = false;
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(255)), ((System.Byte)(192)));
this.richTextBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(155, 163);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(693, 264);
this.richTextBox1.TabIndex = 10;
this.richTextBox1.Text = "";
//
// imageList1
//
this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem3,
this.menuItem4,
this.menuItem16,
this.menuItem13});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem9,
this.menuItem12,
this.menuItem2});
this.menuItem1.Text = "文件";
//
// menuItem9
//
this.menuItem9.Index = 0;
this.menuItem9.Text = "刷新所有列表";
this.menuItem9.Click += new System.EventHandler(this.menuItem9_Click);
//
// menuItem12
//
this.menuItem12.Index = 1;
this.menuItem12.Text = "登录";
this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click);
//
// menuItem2
//
this.menuItem2.Index = 2;
this.menuItem2.Text = "退出";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem5,
this.menuItem6,
this.menuItem15,
this.menuItem14});
this.menuItem3.Text = "论坛";
//
// menuItem5
//
this.menuItem5.Index = 0;
this.menuItem5.Text = "刷新列表";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "同步所有";
this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click);
//
// menuItem15
//
this.menuItem15.Index = 2;
this.menuItem15.Text = "同步选定";
this.menuItem15.Click += new System.EventHandler(this.menuItem15_Click);
//
// menuItem14
//
this.menuItem14.Index = 3;
this.menuItem14.Text = "离线浏览";
this.menuItem14.Click += new System.EventHandler(this.menuItem14_Click);
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem10,
this.menuItem7,
this.menuItem11,
this.menuItem8});
this.menuItem4.Text = "帖子";
//
// menuItem10
//
this.menuItem10.Enabled = false;
this.menuItem10.Index = 0;
this.menuItem10.Text = "回复";
this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click);
//
// menuItem7
//
this.menuItem7.Enabled = false;
this.menuItem7.Index = 1;
this.menuItem7.Text = "发贴";
this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
//
// menuItem11
//
this.menuItem11.Index = 2;
this.menuItem11.Text = "-";
//
// menuItem8
//
this.menuItem8.Index = 3;
this.menuItem8.Text = "搜索...";
this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
//
// menuItem16
//
this.menuItem16.Enabled = false;
this.menuItem16.Index = 3;
this.menuItem16.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem17});
this.menuItem16.Text = "用户";
//
// menuItem17
//
this.menuItem17.Index = 0;
this.menuItem17.Text = "我的参与";
this.menuItem17.Click += new System.EventHandler(this.menuItem17_Click);
//
// menuItem13
//
this.menuItem13.Index = 4;
this.menuItem13.Text = "关于";
this.menuItem13.Click += new System.EventHandler(this.menuItem13_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(848, 449);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.richTextBox1,
this.splitter2,
this.listView1,
this.splitter1,
this.treeView1,
this.statusBar1});
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "CSDN助手.Net";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
Close();
}
private void ShowTopic()
{
int Index = this.listViewIndex;
string buff = "";
try
{
Topic topic = core.GetTopic(topicid,bOffLine);
if(topic != null)
{
string text = "";
text += "主题:";
text += topic.TopicName;
text += "\n所属论坛:";
text += topic.RoomName;
text += " 发贴时间:";
text += topic.PostDateTime.ToString();
text += "\n发贴人:";
text += topic.TopicPoster.PostUserName;
text += "(";
text += topic.TopicPoster.PostUserNickName;
text += ")";
text += " 级别:";
text += topic.TopicPoster.Rank;
text += " 信誉度:";
text += topic.TopicPoster.Credit.ToString();
buff += text;
buff += "\n内容:\n";
buff += topic.Content;
for(int i = 0; i < topic.ReplyIndex.Length; i++)
{
buff += "\n----------------------------------------------------------------------------------------------\n";
buff += "\n回复人:";
buff += topic.ReplyIndex[i].ReplyPoster.PostUserName;
buff += "(";
buff += topic.ReplyIndex[i].ReplyPoster.PostUserNickName;
buff += ")";
buff += " 级别:";
buff += topic.ReplyIndex[i].ReplyPoster.Rank;
buff += " 信誉度:";
buff += topic.ReplyIndex[i].ReplyPoster.Credit.ToString();
buff += "\n回复时间:";
buff += topic.ReplyIndex[i].PostDateTime.ToString();
buff += "\n内容:\n";
buff += topic.ReplyIndex[i].Content;
}
this.richTextBox1.Text = buff;
this.listView1.Items[Index].ImageIndex = 0;
}
else
{
buff = "该帖子已经被损坏";
this.richTextBox1.Text = buff;
this.listView1.Items[Index].ImageIndex = 3;
}
}
catch
{
if (bOffLine==true)
{
statusBar1.Text = "";
this.richTextBox1.Text = "获取离线数据失败,请连接网络更新数据!";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -