Deserialize (binary)

I'm creating a viewer. The first time you go to a directory, you create the data file by processing the files, exacting the images and Serializeing the data into a data file. I then Deserialize that newly created file into the form to be viewed. The second time you go to a directory, it sees that file ans tries to Deserialize it to populate the form. The system works fine when it has to c

反序列化(二进制)

我正在创建一个查看器。 第一次进入目录时,通过处理文件,精确图像和序列化数据到数据文件来创建数据文件。 然后,我将该新创建的文件反序列化为要查看的表单。 第二次进入目录时,它会看到该文件尝试将其反序列化以填充表单。 系统需要首先创建时才能正常工作,但如果已经存在,我会收到未引用的对象错误。 我错过了什么? private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)

got the exception Object reference not set to an instance of an object

I have developed one windows application(C#.net).I got the exception, Object reference not set to an instance of an object. stack trace is at OnamVideoCable.Bill_Generate.btnBill_Click(Object sender, EventArgs e) in C:FinalOnamCableOperatorSoftwareOnamVideoCableOnamVideoCableBill Generate.cs:line 179 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMou

得到了未设置为对象实例的异常对象引用

我开发了一个Windows应用程序(C#.net)。我得到了异常,对象引用未设置为对象的实例。 堆栈跟踪是 OnamVideoCable.Bill_Generate.btnBill_Click(Object sender,EventArgs e)in C: FinalOnam CableOperatorSoftware OnamVideoCable OnamVideoCable Bill Generate.cs:line 179 在System.Windows.Forms.Control.OnClick(EventArgs e) 在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在S

Parameter is not valid. at System.Drawing.Region.GetHrgn(Graphics g)

Parameter is not valid. at System.Drawing.Region.GetHrgn(Graphics g) at System.Windows.Forms.Control.GetHRgn(Region region) at System.Windows.Forms.Control.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Con

参数无效。 在System.Drawing.Region.GetHrgn(图形g)

Parameter is not valid. at System.Drawing.Region.GetHrgn(Graphics g) at System.Windows.Forms.Control.GetHRgn(Region region) at System.Windows.Forms.Control.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Con

parameter is not valid ( LinkLabel on WinForm )

I wrote a Win Forms app to test how a LinkLabel class works. It appears to be fine until I click on the changed LinkLabel. The Form1.cs code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace LinkLabelTest { // Edito

参数无效(WinForm上的LinkLabel)

我写了一个Win Forms应用程序来测试LinkLabel类的工作方式。 直到我点击更改的LinkLabel,似乎没有问题。 Form1.cs代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace LinkLabelTest { // Editor: code not fully indented - lazi

Asp.net Core Post parameter is always null

I'm sending POST from fiddler: POST http://localhost:55924/api/Product HTTP/1.1 User-Agent: Fiddler Host: localhost:55924 Content-Type: application/json; charset=utf-8 Content-Length: 84 {"Ean":"1122u88991","Name":"Post test","Description":"Post test desc"} But Post method always gets null. // POST api/Product [HttpPost] public IActionResult PostProduct([FromBody]Product product) { if

Asp.net Core Post参数始终为空

我从提琴手发送POST: POST http://localhost:55924/api/Product HTTP/1.1 User-Agent: Fiddler Host: localhost:55924 Content-Type: application/json; charset=utf-8 Content-Length: 84 {"Ean":"1122u88991","Name":"Post test","Description":"Post test desc"} 但Post方法始终为空。 // POST api/Product [HttpPost] public IActionResult PostProduct([FromBody]Product product) { if (!ModelState.IsValid)

Hide soft keyboard for editText focus/touch

I am trying to hide the soft keyboard from showing when an EditText either receives focus or a touch event. I want the EditText to be editable - there will be text in the EditText, so I want the EditText to respond to a touch event so the cursor is positioned, but I will have dedicated buttons for editing rather than using the soft keyboard. I can't get this to work - the soft keyboard seem

为editText对焦/触摸隐藏软键盘

我试图隐藏软键盘显示EditText何时接收焦点或触摸事件。 我希望EditText是可编辑的 - EditText中会有文本,所以我想让EditText响应一个触摸事件,以便光标定位,但我将有专门的按钮进行编辑,而不是使用软键盘。 我无法得到这个工作 - 软键盘似乎在focuschange和touch事件上都弹出。 我已将代码缩减为以下内容: AndroidMainifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http:

Is it okay to attach async event handler to System.Timers.Timer?

I have already read SO post here and article here I have a timer event that fires every once in a while and i want to do some asynchronous processing inside the handler, so something along the lines of: Timer timer = new Timer(); timer.Interval = 1000; timer.Elapsed += timer_Elapsed; // Please ignore this line. But some answers already given based on this line so I will l

是否可以将异步事件处理程序附加到System.Timers.Timer?

我已经阅读过这里和这里发布的文章我有一个定时器事件,每隔一段时间触发一次,我想在处理程序中执行一些异步处理,所以沿着以下几行: Timer timer = new Timer(); timer.Interval = 1000; timer.Elapsed += timer_Elapsed; // Please ignore this line. But some answers already given based on this line so I will leave it as it is. timer.Elapsed += async (sender, arguments) => a

How do I send an email to an address with a dash in it?

Is it me or is there a bug in the MailAddress class in System.Net.Mail? This code will always throw an excpetion: MailMessage mail = new MailMessage(); mail.From = new MailAddress("me@me.com"); mail.To.Add("joe-blow@me.com"); mail.Subject = "Test email" mail.IsBodyHtml = true; mail.Body = "<b>Does not work</b>"; //Connect to server and send message. SmtpClient

如何发送电子邮件到其中有破折号的地址?

是我还是在System.Net.Mail的MailAddress类中存在一个错误? 这段代码总是会引起一些注意: MailMessage mail = new MailMessage(); mail.From = new MailAddress("me@me.com"); mail.To.Add("joe-blow@me.com"); mail.Subject = "Test email" mail.IsBodyHtml = true; mail.Body = "<b>Does not work</b>"; //Connect to server and send message. SmtpClient smtp = new SmtpClient(); sm

Email Support section with the users address as "From address"

I need to implement a “email support” section in our application. So email “To” address will be admin@mydomain.com” and from address will be the email address of the end user.(The end users email address may be on the same domain or another domain like user@mydomain.com or user@gmail.com). In the application I am authenticated the email using admins account details (username and password) Sys

电子邮件支持部分的用户地址为“发件人地址”

我需要在我们的应用程序中实施“电子邮件支持”部分。 因此,电子邮件地址将为admin@mydomain.com,地址为最终用户的电子邮件地址(最终用户的电子邮件地址可能位于相同的域或其他域,如user@mydomain.com或用户@ gmail.com)。 在应用程序中,我使用管理员帐户详细信息(用户名和密码)对电子邮件进行身份验证 System.Net.NetworkCredential("admin@mydomain.com", adminpassword); 此外,我使用主机地址作为“mail.mydomain.

Optimizing disk IO

I have a piece of code that analyzes streams of data from very large (10-100GB) binary files. It works well, so it's time to start optimizing, and currently disk IO is the biggest bottleneck. There are two types of files in use. The first type of file consists of a stream of 16-bit integers, which must be scaled after I/O to convert to a floating point value which is physically meaningful

优化磁盘IO

我有一段代码可以分析非常大(10-100GB)二进制文件的数据流。 它运行良好,因此是时候开始优化了,目前磁盘IO是最大的瓶颈。 有两种类型的文件正在使用中。 第一种类型的文件由16位整数组成,必须在I / O之后进行缩放以转换为具有物理意义的浮点值。 我以块的形式读取文件,并通过一次读取一个16位代码读取大块数据,执行所需的缩放,然后将结果存储在一个数组中。 代码如下: int64_t read_current_chimera(FILE *input,