我是C#.Net中为Windows窗体应用程序创建向导的新手.所以我对创建向导没有任何想法.请给我一些关于创建多个向导的想法.
此致,拉维
如何枚举字典?
假设我foreach()用于dictionay枚举.我无法更新里面的键/值对foreach().所以我想要一些其他的方法.
我想减去一个DateTime.例:
date1 = 13/01/2004 12:20:00
result = Subtract(date1-15);
Run Code Online (Sandbox Code Playgroud)
预期产量:
13/01/2004 12:05:00
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
我想比较两个dateTime.
例如:
date1 = 13/01/2004 12:20:00
date2 = 13/01/2004 12:35:00
result = Compare(date2-date1);
O/P : 15 Minutes
Run Code Online (Sandbox Code Playgroud) 我是python脚本的开始.我想读取msaccess数据库记录并写入XML文件.Access数据库表有超过20000条记录.
现在我能够做到,但需要4到5分钟.所以我实现了线程概念.但线程也需要超过5到6分钟.因为每个线程都打开数据源从表中读取记录并关闭数据源.
我不知道如何解决这些问题.
class ConfigDataHandler(Thread):
def __init__(self, dev):
Thread.__init__(self)
self.dev = dev
def run(self):
db_source_path = r'D:\sampleDB.mdb'
db_source = win32com.client.Dispatch(r'ADODB.Connection')
db_source.ConnectionString = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;
DATA SOURCE=' + db_source_path + ';'
db_source.Open()
query = """ SELECT * from table"""
source_rs = win32com.client.Dispatch(r'ADODB.Recordset')
source_rs.Open(query, db_source, 3, 1)
while not source_rs.EOF :
f_units.append(source_rs.fields("Name").Value))
source_rs.MoveNext()
source_rs.Close()
db_source.Close()
out = render(f_units)
open("D:/test.xml", "w").write(out)
d_list = get_dev_list()
for d in d_list:
current = ConfigDataHandler(d)
current.start()
Run Code Online (Sandbox Code Playgroud) 嗨,我想用C#动态连接字符串.我在XML文件中有本地化的字符串,这个字符串我想根据运行时的语言选择进行更新.
下面我指定了输入字符串和预期输出字符串格式.
EX:
*Input String:*
"The density of your %s gas at reference conditions of %s %s and %s %s is:"
*Expected Output String:*
"The density of your Helium gas at reference conditions of 20.01 g and 15.12 Kg is:"
Run Code Online (Sandbox Code Playgroud)
谢谢
c# ×6
datetime ×2
winforms ×2
.net ×1
dictionary ×1
enumeration ×1
python ×1
string ×1
wizard ×1
xml ×1