我想给我的用户一个简单的Winforms GUI界面,以便他们可以查看和编辑我的应用程序的配置文件,但现在没有时间做自定义的硬编码解决方案.
此外,我的项目现在对可配置设置的要求不断变化 - 如果解决方案会自动发现并显示添加到配置文件中的新设置,那将是很好的.
对于用户界面,我正在考虑一个简单的2列键值网格.用户可以编辑"值"列中的字段,并将它们保存回配置文件.
我想知道是否可以将网格直接数据绑定到配置文件,或者通过一些简单的胶合逻辑.
或者也许Winforms控件已经做了类似的事情?
欢迎所有建议......
我使用以下代码成功通过GMail的SMTP服务器发送电子邮件:
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.ssl", "true");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.timeout", "5000");
props.put("mail.smtp.connectiontimeout", "5000");
// Do NOT use Session.getDefaultInstance but Session.getInstance
// See: http://forums.sun.com/thread.jspa?threadID=5301696
final Session session = Session.getInstance( props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication( USER, PWD );
}
});
try {
final Message message = new MimeMessage(session);
message.setFrom( new InternetAddress( USER ) );
message.setRecipients( Message.RecipientType.TO, InternetAddress.parse( TO ) );
message.setSubject( emailSubject );
message.setText( emailContent );
Transport.send(message); …Run Code Online (Sandbox Code Playgroud) 我在"dd-MM-yyyy HH:mm"中有一个字符串,需要将其转换为格式为"yyyy-MM-dd HH:mm"的日期对象.
下面是我用来转换的代码
oldScheduledDate = "16-05-2011 02:00:00";
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date oldDate = (Date)formatter.parse(oldScheduledDate);
Run Code Online (Sandbox Code Playgroud)
现在当我打印oldDate时,我明白了
Sat Nov 01 02:00:00 GMT 21,这是完全错误的,我在这里做错了什么?
php如何处理这样的事情......
$blah = "Testing a variable";
$$blah = "test";
Run Code Online (Sandbox Code Playgroud)
我的新变量名称是什么?
我正在尝试使用maven-gpg-plugin:sign以便在部署到Sonatype OSS存储库之前签署项目工件.问题是我应该在哪里保密密码secring.gpg:
~/.gnupg目录中src/test/resources/gpg/secring.gpg为什么?
有没有办法从所有行中减去第一个选定行的值?所以,如果我有
t = 1, v = 500
t = 2, v = 800
t = 3, v = 1200
Run Code Online (Sandbox Code Playgroud)
我会的
t = 1, v = 0
t = 2, v = 300
t = 3, v = 700
Run Code Online (Sandbox Code Playgroud)
我一直在寻找便携式解决方案,但Postgres解决方案的工作原理相同:-)谢谢.
如果我的模型中有两个实体,"People"和"Addresses",并且一个特定Person有零个或多个地址,通过AddressList导航属性访问,我可以编写一个OData查询来回答以下问题:
"哪个人的姓氏以史密斯结尾,至少有一个地址?"
在我看来,我只能在这里做一个谓词,例如
http:// localhost:55100/DemographicsDataService.svc/People?$ filter = endswith(LastName,'Smith')
(我还不相信我甚至可以写一个$ filter来处理第二个谓词..在这种情况下,假设我试图回答这个问题,"姓氏以史密斯结尾,名字以玛丽开头")
嘿.我在使用-ansi -pedantic编译时遇到错误-ansi -pedantic.为什么会这样?
在'/'标记之前的预期表达式
程序中迷路'\ 347'
示例代码 // Comment here
我有很多这些错误,它是什么?
我有2节课
Public Class Shipper
Public Property ShipperID As Long
Public Property CreateDate As DateTime
Public Property ShipperCode As String
Public Property ShipperName As String
Public Property ShippingMethods As List(Of ShippingMethod)
Public Class ShippingMethod
Public Property ShippingMethodID As Long
Public Property ShipperID As Long
Public Property CreateDate As DateTime
Public Property ShipppingMethod As String
Public Property ShipppingMethodCode As String
Run Code Online (Sandbox Code Playgroud)
我正在尝试搜索托运人名单为空白且托运人姓名不为空白的托运人名单 - 我得到了
Dim oListShipper As List(Of Shipper) = GetAllShippers()
Dim oListShipperRet As List(Of Shipper) = _
oListShipper.FindAll(Function(c) (c.ShipperCode = "" And …Run Code Online (Sandbox Code Playgroud)