what kind of format is this?

I have the following DateTime string 2014-11-03 08:44:00:082467 Z When I try to do c simple Convert.ToDateTime I got and error that it's not a recognized DateTime string. I also tried what's suggested in the post here: DateTime.Parse("2012-09-30T23:00:00.0000000Z") always converts to DateTimeKind.Local var date = DateTime.ParseExact("2012-09-30T23:00:00.0000000Z",

这是什么样的格式?

我有以下DateTime字符串2014-11-03 08:44:00:082467 Z 当我尝试做简单的Convert.ToDateTime我得到了错误,它不是一个公认的DateTime字符串。 我也尝试过在这里发布的内容:DateTime.Parse(“2012-09-30T23:00:00.0000000Z”)总是会转换为DateTimeKind.Local var date = DateTime.ParseExact("2012-09-30T23:00:00.0000000Z", "yyyy-MM-dd'T'HH:mm:ss.fffffff'Z'",

Convert DateTime to Utc only if not already Utc

I'm using the DateTimeWithZone struct that Jon Skeet posted at Creating a DateTime in a specific Time Zone in c# fx 3.5 This didn't work exactly for my situation since it assumes that the DateTime passed in the constructor is the local time, and therefore converts it to Utc using the specified TimeZone. In my case we will mostly be passing in DateTime objects already in Utc (since thi

仅在尚未使用Utc的情况下才将DateTime转换为Utc

我使用Jon Skeet在c#fx 3.5的特定时区创建DateTime时发布的DateTimeWithZone结构 这并不适用于我的情况,因为它假定在构造函数中传递的DateTime是本地时间,因此使用指定的TimeZone将其转换为Utc。 在我的情况下,我们将主要传递已经在Utc中的DateTime对象(因为这是我们正在存储的),所以如果源DateTime.Kind不是Utc,我们只需要执行转换。 因此我将构造函数更改为: public DateTimeWithZone(DateTime dateTime, T

c# Serialize with JSON.NET inherited private fields

I have an object structure (in external dll) like this: public class Demo2 { private int count; public Demo2() { count = 2; } } public class MyDemo : Demo2 { private int count; public MyDemo() { count = 3; } } public class Perform { static void Main(string[] args) { MyDemo d

c#使用JSON.NET继承私有字段进行序列化

我有一个像这样的对象结构(在外部dll中): public class Demo2 { private int count; public Demo2() { count = 2; } } public class MyDemo : Demo2 { private int count; public MyDemo() { count = 3; } } public class Perform { static void Main(string[] args) { MyDemo d = new MyDemo(

WPF Binding not updating from DispatcherTimer

The following is a stripped back version of a problem I'm encountering. It's a fairly common issue, but I'm struggling to find the solution. I've an instantiated class which I've bound to an item on my main window. This class contains a DispatcherTimer which is used to update a value. In the example given it's incrementing this value by 1 every second. I'd expec

WPF绑定不从DispatcherTimer更新

以下是我遇到的问题的简化版本。 这是一个相当普遍的问题,但我正在努力寻找解决方案。 我有一个实例化的类,我已经绑定到我的主窗口上的项目。 该类包含一个用于更新值的DispatcherTimer。 在给出的例子中,它每秒增加一个这个值。 我希望我的表单上的绑定项能够通过相应地更新其值来反映此更改,但它永远不会更新。 从阅读对StackOverflow的类似问题的其他反应,我有一种感觉,这是由于主UI线程的性质单独运行到导致

Time out when executing a search wpf

When i execute a search in my application I want to have a timeout-function that gives the user a message and stops the search after 10 seconds. How is this possible? Can you show me the code for that? Let me know if you need to se my code and which part you need to see. Thank you Hello! Here is the Code. Forgot to tell you im using a backgroundworker do the suggestions you posted wont

执行搜索wpf时超时

当我在我的应用程序中执行搜索时,我想要有一个超时函数,它给用户一条消息并在10秒后停止搜索。 这怎么可能? 你能告诉我那个代码吗? 如果您需要查看我的代码以及您需要查看的部分,请告诉我。 谢谢 你好! 这是守则。 忘了告诉你即时通讯使用背景工作者做你张贴的建议不会工作。 我想为这件作品设定一个时间限制 private void worker_DoWork(object sender,DoWorkEventArgs e){progress = 0; 秒表sw =新秒

Connecting SQL Azure to Windows Phone 7 using WCF

I'm new in programming windows phone 7 but get really tired cuz i spend 3 days on one problem. I search all internet and get some good explanions but without luck - it doesn't work on me program. I create in SQL Azure one table which i called dbo.Messenger with structure: id (PK, not null) category (nvarchar(30), null) message (nvarchar(max), null) description (nvarchar(200), n

使用WCF将SQL Azure连接到Windows Phone 7

我是编程windows phone 7的新手,但真的很累,因为我花了3天时间处理一个问题。 我搜索所有的互联网,并得到一些很好的解释,但没有运气 - 它不适用于我的程序。 我在SQL Azure中创建了一个我称之为dbo.Messenger的表: id(PK,非空) 类别(nvarchar(30),null) 消息(nvarchar(max),null) 描述(nvarchar(200),null) 然后我为它做WCF wchich应该给我一个清单: [OperationContract] Li

System.Threading.Timer interval in Windows Service

I have developed the windows service & in widows service used the system.threading.timer .in this the timers works fine but sometimes it will shifting the timing of the execution eg I have set the timer to the 10 sec then it executed at every 10 sec but sometimes it will started at 11 sec . I have got this output 18-08-2011 10:00:10 18-08-2011 10:00:10 18-08-2011 10:00:20 18-08-2011 10:0

Windows服务中的System.Threading.Timer时间间隔

我已经开发了Windows服务&寡妇服务使用system.threading.timer。在这个定时器工作正常,但有时它会改变执行的时间,例如我已经设置定时器到10秒,然后它执行每10秒,但有时会在11秒后开始。 我有这个输出 18-08-2011 10:00:10 18-08-2011 10:00:10 18-08-2011 10:00:20 18-08-2011 10:00:30 18-08-2011 10:00:40 18-08-2011 10:00:11 18-08-2011 10:00:22 18-08-2011 10:00:33 18-08-2011 10:00:44 但我想输出为 18-08-2

Inheritance issue

i am facing a issue in Inheritance i have a interface called Irewhizz interface irewhzz { void object save(object obj); void object getdata(object obj); } i write definition in different class like public user:irewhzz { public object save(object obj); { ....... } public object getdata(object obj); { ....... } } this is antoher class public client:irewhzz { public object sav

继承问题

我面临着一个继承问题,我有一个名为Irewhizz的界面 interface irewhzz { void object save(object obj); void object getdata(object obj); } 我写了不同类的定义 public user:irewhzz { public object save(object obj); {.......} 公共对象getdata(object obj); {.......}} 这是antoher类 public client:irewhzz { public object save(object obj); { ....... } public obj

WPF multithreaded progress dialog

Updated This is kind of an interesting problem I am experiencing. I need to have a progress dialog show when a background process is running. Normally, this would work but the problem is that I need to set public static data within the background process. Here is an example of what I am attempting to accomplish: public partial class MainWindow : Window { public static Service binding;

WPF多线程进度对话框

更新这是我遇到的一个有趣的问题。 当后台进程运行时,我需要进行进度对话框显示。 通常情况下,这将工作,但问题是我需要在后台进程中设置公共静态数据。 以下是我试图完成的一个例子: public partial class MainWindow : Window { public static Service binding; public static Result lr; public progressDialog dlg; private void login() { string sPwd = txtPwd.Password; str

Add Generic list in a MyClass but how?

How can i add list in a generic class? Firstly My generic Class is that: [Serializable] public class ScheduleSelectedItems { private string Frequency; List FrequencyDays = new List(); private string Time; private string StartTime; private string EndTime; private string StartDate; private string EndDate; private string Name;

在MyClass中添加通用列表,但如何?

我如何在通用类中添加列表? 首先我的通用类是: [Serializable] public class ScheduleSelectedItems { private string Frequency; List FrequencyDays = new List(); private string Time; private string StartTime; private string EndTime; private string StartDate; private string EndDate; private string Name; public ScheduleS