草庐IT

evented-io

全部标签

c# - 在 asp :repeater on button click event 中找到控件

我在asp:repeater项目模板中有一个下拉列表。我怎样才能在按钮点击事件中获得它的值(value)。protectedDropDownListddlWorkflowMembers=newDropDownList();protectedvoidWorkflowListAfterItemCreated(objectsender,RepeaterItemEventArgse){ddlWorkflowMembers=(DropDownList)e.Item.FindControl("ddlWorkflowMembers");}protectedvoidBtnSaveClick(objec

c# - react 性扩展 : Process events in batches + add delay between every batch

我有一个应用程序,它有时几乎同时引发1000个事件。我想做的是将事件批处理为50个项目的block,并开始每10秒处理一次。在开始新的批处理之前无需等待批处理完成。例如:10:00:00:10000neweventsreceived10:00:00:StartProcessing(events.Take(50))10:00:10:StartProcessing(events.Skip(50).Take(50))10:00:15:StartProcessing(events.Skip(100).Take(50))有什么想法可以实现吗?我想ReactiveExtensions是可行的方法,

c# - 未知模块中发生类型为 'System.IO.FileNotFoundException' 的未处理异常

我正在开发一个C#应用程序,但在调试运行时出现以下错误:Anunhandledexceptionoftype'System.IO.FileNotFoundException'occurredinUnknownModule.Additionalinformation:Couldnotloadfileorassembly'Autodesk.Navisworks.Timeliner.dll'oroneofitsdependencies.Thespecifiedmodulecouldnotbefound.Autodesk.Navisworks.Timeliner.dll位于应用程序的调试文件夹

c# - 在 System.IO.Directory.GetFiles() 中排除文件扩展名

有没有办法获取文件夹中的文件数,但我想排除扩展名为jpg的文件?Directory.GetFiles("c:\\Temp\\").Count(); 最佳答案 试试这个:varcount=System.IO.Directory.GetFiles(@"c:\\Temp\\").Count(p=>Path.GetExtension(p)!=".jpg");祝你好运! 关于c#-在System.IO.Directory.GetFiles()中排除文件扩展名,我们在StackOverflow上找到

c# - 跨线程操作无效(How to access WinForm elements from another module events?)

我有一个带有串行端口信号事件的模块serialPort.DataReceived.AddHandler(SerialDataReceivedEventHandler(DataReceived));DataReceived在哪里letDataReceivedab=rxstringProcessData正在调用WinForms方法letProcessData(a,b)=dataProcessor.Invoke(a,b)|>ignore这是privatevoidProcessData(objectsender,EventArgse){byte[]m=Core.ncon.ArrayRead;s

c# - 从IOS图片上传到.net app : Rotate

我有以下代码用于将图片从IOS设备上传到我的.net应用程序并调整其​​大小。用户习惯以纵向拍摄照片,然后所有照片都以错误的旋转方式显示在我的应用程序中。有什么解决方法的建议吗?stringfileName=Server.HtmlEncode(FileUploadFormbilde.FileName);stringextension=System.IO.Path.GetExtension(fileName);System.Drawing.Imageimage_file=System.Drawing.Image.FromStream(FileUploadFormbilde.PostedF

c# - 'Event' 的无效值 - 属性 (XAML Eventsetter)

我正在使用VisualStudio2015社区,但收到以下错误消息:Invalidvaluefor'Event'-Property:Microsoft.VisualStudio.DesignTools.Xaml.LanguageService.Semantics.XmlValue.下面是代码:我试过UIElement.MouseEnter、Mouse.MouseEnter、TextBox.MouseEnter。如果我编译处理程序工作正常,但错误消息仍然存在。有什么建议吗? 最佳答案 这似乎是WPF设计器中的一个错误,正如已经报告的那

c# - UIElement.AddHandler() 与 .Event += 定义

问题的第一部分:这2个事件注册之间有什么区别?_popUp.AddHandler(PreviewMouseLeftButtonDownEvent,newMouseButtonEventHandler(PopUp_PreviewMouseLeftButtonDown));_popUp.PreviewMouseLeftButtonDown+=newMouseButtonEventHandler(_popUp_PreviewMouseLeftButtonDown);问题的第二部分:或最终与popUp.Opened+=PopUp_Opened; 最佳答案

c# - 可移植类库不支持System.IO,为什么?

我创建了一个可移植类库,用于我的Monodroid项目。但问题是我需要System.IO库,但不幸的是我无法添加它。我什至尝试通过“添加引用”选项添加它,但没有成功。为什么会这样?我该怎么做? 最佳答案 您不能使用System.IO,因为它不是可移植类库。System.IO进行特定于其运行的操作系统(Windows)的调用,而可移植类库是跨平台的。可以找到您正在寻找的解决方案here:Whatshouldyoudowhenyou’retryingtowriteaportablelibrarybutyouneedsomefunctio

c# - 如何检查 System.IO.File.Delete 是否成功删除文件

使用system.io.file类删除文件后:System.IO.File.Delete(openedPdfs.path);如果文件被成功删除,我需要运行一些代码。只要该方法不返回任何值,我就会在delete方法之后检查文件是否存在。如果它仍然存在,我认为操作失败。问题是,删除方法工作正常,但要删除文件需要几秒钟。Exist函数返回true,因为当时它正在检查文件是否存在。我如何确定System.IO.File.Delete(openedPdfs.path);是否成功完成?代码:FileInfofile=newFileInfo(openedPdfs.path);System.IO.Fi