据说是一本可以了解人性的书,看了之后,就是看到了一个简单的故事,平淡无奇。
对照现在的社会,也差不多那个样子,只不过不在种族偏见上,在其他方面。

人类社会在进化的过程中,会产生一些伤害,而恰恰就是因为这些伤害才不断的推动社会的发展。

20201018_203258.png

样例

System.Windows.MessageBox.Show($"delete file failed. msg={e.Message}");

if (System.Windows.MessageBox.Show("是否确认关机?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
Process.Start("shutdown.exe", "/s /t 0");//关机
}

世界文学奖

  • 诺贝尔文学奖
  • 纽斯塔特国际文学奖
  • 卡夫卡奖
  • 耶路撒冷奖

美国文学奖

  • 美国国家图书奖

  • 普利策奖

  • 美国国家杂志奖

阅读全文 »

参加基本养老保险的个人,达到法定退休年龄时累计缴费满十五年的,按月领取基本养老金。到龄当月也是需要缴纳社保费的,所以不需要提前一个月去办理。在到龄当月办理养老金申领手续即可。

影响城镇职工基本养老金水平的因素主要有:缴费基数、缴费年限(含视同缴费年限)、个人账户累积额及退休时上海市上年度职工月平均工资等。

简单来说,缴费基数越高,缴费年限越长,退休时领到的养老金就越多,也就是多缴多得,长缴多得。

对话框

tk.messagebox.showwarning(title='警告', message='请选择一个测量点,在执行本操作。')

输入对话框

class InputDlg(tk.Toplevel):
def __init__(self):
super().__init__()
self.title('新方案名称')
topFrame = tk.Frame(self)
tk.Label(topFrame, text="方案名称:").pack(side=tk.LEFT)
self.solutionStr = tk.StringVar()
self.solutionEntry = ttk.Entry(topFrame, width=20, textvariable=self.solutionStr)
self.solutionEntry.pack(side=tk.LEFT, padx=4)
self.btnConfirm = tk.Button(topFrame, text="确定", command=self.on_btn_confirm).pack(side=tk.LEFT, padx=4)

topFrame.pack(side=tk.TOP, anchor='w')
self.center_window(250, 100)

def center_window(self, width=1500, height=768):
# get screen width and height
screen_width = self.winfo_screenwidth()
screen_height = self.winfo_screenheight()

# calculate position x and y coordinates
x = (screen_width / 2) - (width / 2)
y = (screen_height / 2) - (height / 2)
self.geometry('%dx%d+%d+%d' % (width, height, x, y))

def on_btn_confirm(self):
self.quit()
self.destroy()
# print("用户名:%s" % (self.solutionStr.get().strip()))


# 调用
self.isInputShow = False

if not self.isInputShow:
self.isInputShow = True
app = InputDlg()
app.focus_set()
app.solutionEntry.focus_set()
self.wait_window(app) # 这一句很重要!!!
name = app.solutionStr.get().strip()
print(name)
self.isInputShow = False

class InputDlg(tk.Toplevel):
def __init__(self):
super().__init__()
self.title('新方案名称')
topFrame = tk.Frame(self)
tk.Label(topFrame, text="方案名称:").pack(side=tk.LEFT)
self.solutionStr = tk.StringVar()
self.solutionEntry = ttk.Entry(topFrame, width=20, textvariable=self.solutionStr)
self.solutionEntry.pack(side=tk.LEFT, padx=4)
self.btnConfirm = tk.Button(topFrame, text="确定", command=self.on_btn_confirm).pack(side=tk.LEFT, padx=4)

topFrame.pack(side=tk.TOP, anchor='w')
self.center_window(250, 100)

def center_window(self, width=1500, height=768):
# get screen width and height
screen_width = self.winfo_screenwidth()
screen_height = self.winfo_screenheight()

# calculate position x and y coordinates
x = (screen_width / 2) - (width / 2)
y = (screen_height / 2) - (height / 2)
self.geometry('%dx%d+%d+%d' % (width, height, x, y))

def on_btn_confirm(self):
self.quit()
self.destroy()
# print("用户名:%s" % (self.solutionStr.get().strip()))


# 调用
self.isInputShow = False

if not self.isInputShow:
self.isInputShow = True
app = InputDlg()
app.focus_set()
app.solutionEntry.focus_set()
self.wait_window(app) # 这一句很重要!!!
name = app.solutionStr.get().strip()
print(name)
self.isInputShow = False

c#建立的控制台程序运行时如何不弹出DOS窗口

// 创建好控制台程序后,选中项目,右键,属性,输出类型选为“windows 应用程序” 这样就没有dos窗口了。

单例模式

var curId = System.Diagnostics.Process.GetCurrentProcess().Id;

bool isAppRunning = false;
var name = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
System.Threading.Mutex mutex = new System.Threading.Mutex(true, name, out isAppRunning);
if (!isAppRunning)
{
Log.Warning("already running. kill the running one.");
foreach (var process in Process.GetProcessesByName(name))
{
if (process.Id != curId)
{
process.Kill();
}
}
}

Application.Current.Shutdown();

// 立即中断程序执行并退出,这个方法用起来的感觉类似在任务管理器里找到进程并终止,即
Environment.Exit(0)

// 一般关闭当前窗体使用:
this.Close();

根据近些年来的研究综合数据,蚊子寻找目标时的确有选择性,一般有三种要素决定了蚊子的目标:体温、二氧化碳和体味,而代谢率和皮肤表面的细菌似乎在其中起着重要作用。