This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ilike() { | |
var j = document.getElementsByClassName("qz_like_btn_v3 _likeBtn c_tx ui_mr10"); | |
var count = 0; | |
for (var i = count; i < j.length; i++) { | |
if (j[i].innerHTML.slice(0, 1) == "赞") { | |
j[i].click(); | |
count++; | |
} | |
} | |
window.document.body.scrollTop = window.document.body.scrollHeight - 1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) | |
{ | |
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) | |
{ | |
// 关闭所有的线程 | |
this.Dispose(); | |
this.Close(); | |
} | |
else | |
e.Cancel = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void button1_Click(object sender, EventArgs e) | |
{ | |
if (MessageBox.Show("是否确认?", "请确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) | |
{ | |
MessageBox.Show("ok"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 检查各个控件是否有空值 | |
/// </summary> | |
/// <returns>无空值返回true</returns> | |
private Boolean CheckEmpty() | |
{ | |
foreach (Control cur in this.Controls) | |
{ | |
//if (cur is TextBox && cur.Text == "") /*两种方式皆可,下面的更好*/ | |
if(cur is TextBox && string.IsNullOrEmpty(cur)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
try | |
{ | |
IPAddress ipTest = IPAddress.Parse(txtBox1.Text);//string转化为ip地址 | |
} | |
catch (Exception) | |
{ | |
toolTip1.Show("ip有误", txtBox1, 2000); //2000是提示显示的时间,单位毫秒 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TabPage[] tp=new TabPage[4]; | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
for (int i = 1; i < tabControl1.TabPages.Count; i++) | |
{ | |
tp[i] = tabControl1.TabPages[i]; | |
} | |
for (int i = 1; i < tp.Length; i++) | |
{ | |
tabControl1.TabPages.Remove(tp[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class INIClass | |
{ | |
public string inipath; | |
[DllImport("kernel32")] | |
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); | |
[DllImport("kernel32")] | |
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); | |
/// <summary> |
NewerOlder