Loading Icons from a given path to display in WPF window

I have a tree that displays the directory and another panel that displays the files. Right now the files displayed have no icons. All i know is the path to the file. What i woudl like to do is get that files icon to display in that panel. I need the output to be and Image.source. Currently this is what i have private ImageSource GetIcon(string filename) { System.Drawing.Icon

从给定路径加载图标以在WPF窗口中显示

我有一个显示目录的树和另一个显示文件的面板。 现在显示的文件没有图标。 我所知道的是文件的路径。 我想要做的是让该文件图标显示在该面板中。 我需要输出和Image.source。 目前这就是我所拥有的 private ImageSource GetIcon(string filename) { System.Drawing.Icon extractedIcon = System.Drawing.Icon.ExtractAssociatedIcon(filename); ImageSource imgs; using (System.Drawing.

MSTest Test Context Exception Handling

Is there a way that I can get to the exception that was handled by the MSTest framework using the TestContext or some other method on a base test class? If an unhandled exception occurs in one of my tests, I'd like to spin through all the items in the exception.Data dictionary and display them to the test result to help me figure out why the test failed (we usually add data to the exception

MSTest测试上下文异常处理

有没有办法让我可以使用TestContext或其他基础测试类的方法来处理由MSTest框架处理的异常? 如果在我的一个测试中发生未处理的异常,我想旋转异常数据字典中的所有项并将它们显示给测试结果,以帮助我找出测试失败的原因(我们通常将数据添加到例外,以帮助我们调试生产环境,所以我想要做同样的测试)。 注意:我没有测试异常是否被发现(我有其他测试),我正在测试一个有效的案例,我只需要查看异常数据。 这是我正在谈

How is the performance of entity framework 4 vs entity framework 3.5?

I have one query on my page that takes at least a half second to execute using EF 3.5. When I used a stored procedure the speed was noticably faster. It is a very complex query. Will there be any performance improvements in the upcoming EF 4.0? And does EF 4.0 really beat out 3.5 performance wise? The short answer is it's too early to tell. The .Net guys are focusing almost entirely on

实体框架4与实体框架3.5的性能如何?

我的页面上有一个查询需要至少半秒来执行EF 3.5。 当我使用存储过程时,速度明显更快。 这是一个非常复杂的查询。 在即将到来的EF 4.0中是否会有性能改进? EF 4.0是否真的击败了3.5性能呢? 简短的回答是现在说得太早。 .Net人几乎完全关注性能,直到4月12日发布的版本才能最终确定和本地化。 另外,更快的意思是什么? 更快速的可以通过多种方式查看,例如: 实体框架4.0具有新功能,单独的对象跟踪改进可能意味着

Hiding Controls as a Form of Web Security, Suggestions for Better?

I am working on a website (developed in ASP.NET with C#) that was passed on to me. As I'm working through the site, I notice much of the site has this type of code in it: EmailLabel.Visible = false; WhateverButton.Visible = false; AnotherControl.Visible = false; ... This is all typically done in the code-behind of the site (in the Page_Load method). Essentially, this was put in place to p

隐藏控件作为网络安全形式,建议更好?

我正在开发一个网站(用C#开发的ASP.NET),这个网站传递给我。 当我在网站上工作时,我注意到网站的很多部分都有这种类型的代码: EmailLabel.Visible = false; WhateverButton.Visible = false; AnotherControl.Visible = false; ... 这通常都是在网站的代码隐藏中完成的(在Page_Load方法中)。 本质上,这是为了防止未登录的用户访问组件(该网站的规则是,未登录的用户在登录前应该无法看到网站的任何部分)。 上面的

How can I populate ASPX Textbox controls using a SQL Inner Join statement in C#

My intention is to populate textbox controls on an ASPX page using a SQL Inner Join. One textbox control(txtContactNum) is to be populated from my CompanyContacts table, while the other two textboxes(txtCity, txtURL) are to be populated from the Companies table. Here are the SQL Inner Join statements I have tried in the btnSelectCompany Event Handler: comm = new SqlCommand("Select Compan

如何在C#中使用SQL Inner Join语句填充ASPX Textbox控件?

我的意图是使用SQL Inner Join在ASPX页面上填充文本框控件。 一个文本框控件(txtContactNum)将从我的CompanyContacts表中填充,而其他两个文本框(txtCity,txtURL)将从公司表中填充。 以下是我在btnSelectCompany事件处理程序中尝试的SQL Inner Join语句: comm = new SqlCommand(“Select CompanyContacts.ContactNum,Companies.CompanyNum,Companies.CompanyName,Companies.City,Companies.URL Companies INNER JO

c# closing sqlconnection and sqldatareader or not?

I have this piece of code: SqlConnection conn; string strconString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLCONN"].ToString(); conn = new SqlConnection(strconString); string cmdstr = "select status from racpw where vtgid = " + vtgid; SqlCommand cmdselect = new SqlCommand(cmdstr, conn); conn.Open(); SqlDataReader dtr = cmdselect.ExecuteReader(); if (dtr.Read()) { return;

关闭sqlconnection和sqldatareader或不是?

我有这段代码: SqlConnection conn; string strconString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLCONN"].ToString(); conn = new SqlConnection(strconString); string cmdstr = "select status from racpw where vtgid = " + vtgid; SqlCommand cmdselect = new SqlCommand(cmdstr, conn); conn.Open(); SqlDataReader dtr = cmdselect.ExecuteReader(); if (dtr.Read()) { return; } else { ..

C# SQL Columns into ComboBox

My SQL query isn't dropping anything into the combobox. The connection seems to be made but the while loop doesn't seem to work. Can anybody tell me what it wrong? string sqltable = ("dbo.SLTDS_C"+id+"_table"); SqlConnection con = new SqlConnection("Data Source=" + server + ";Initial Catalog=" + database + ";Integrated Security=" + security); con.Open(); string sqldatapull =

将C#SQL列转换为ComboBox

我的SQL查询不会丢弃任何东西到组合框中。 连接似乎已经完成,但while循环似乎不起作用。 有人可以告诉我什么是错的吗? string sqltable = ("dbo.SLTDS_C"+id+"_table"); SqlConnection con = new SqlConnection("Data Source=" + server + ";Initial Catalog=" + database + ";Integrated Security=" + security); con.Open(); 字符串sqldatapull =(“从syscolumns中选择名称,其中id = object_id('”+ sqlta

gstreamer pipeline rtspsrc reconnect

I'm attempting to add some functionality to reconnect my rtspsrc to an IP camera. Everything works fine when the application is launched. Then I power cycle the IP Camera to simulate a connection issue. When an error is received on the message bus for the rtsp connection, the rtspsrc moves through these states: pause->null->ready->playing. I also find that I need to relink the rt

gstreamer管道rtspsrc重新连接

我试图添加一些功能来将我的rtspsrc重新连接到IP摄像头。 当应用程序启动时,一切正常。 然后我重新启动IP摄像机以模拟连接问题。 当在rtsp连接的消息总线上收到错误时,rtspsrc会在这些状态中移动:暂停 - >空 - >准备 - >播放。 我还发现,重新启动后(rtph264depay),我需要将rtspsrc src焊盘重新链接到下一个元素的接收器焊盘。 我只将src打击垫和视频帽连接起来(这是流水线在工作时最初启动的方式)。 这

Linking audio and video bins with gstreamer in c

Getting error for linking audio and video bins: gst_pad_set_active: assertion 'GST_IS_PAD (pad)' failed Trying to convert the following pipeline to C applications: gst-launch-1.0 rtspsrc location="rtsp://" latency=0 name=demux demux. ! queue ! rtpmp4gdepay ! aacparse ! avdec_aac ! audioconvert ! audioresample ! autoaudiosink demux. ! queue ! rtph264depay ! h264pa

将音频和视频箱与gstreamer链接在c

连接音频和视频存储箱时出错:gst_pad_set_active:assertion'GST_IS_PAD(pad)'failed 试图将以下管道转换为C应用程序: gst-launch-1.0 rtspsrc location =“rtsp://”latency = 0 name = demux demux。 ! 队列! rtpmp4gdepay! aacparse! avdec_aac! audioconvert! audioresample! autoaudiosink demux。 ! 队列! rtph264depay! h264parse! omxh264dec! videoconvert! videoscale!

How to capture only video from audio

I want to capture only video from Audio-Video file that file format are .webm and i am going to convert this into .mp4 format which will be consist of only video file. gst-launch filesrc location=/home/project/teri_meri_kahaani_theatrical_trailer_2.webm ! decodebin2 ! ffenc_mpeg2video ! mpegvideoparse ! queue ! filesink location=/home/project/h.mp4 I used this pipeline but its not workin

如何仅从音频中捕捉视频

我只想捕捉音频视频文件中的视频文件格式是.webm,我将把它转换成只包含视频文件的.mp4格式。 gst-launch filesrc location = / home / project / teri_meri_kahaani_theatrical_trailer_2.webm! decodebin2! ffenc_mpeg2video! mpegvideoparse! 队列! filesink location = / home / project / h.mp4 我使用这个管道,但它不工作。 请告诉我如何做到这一点... 谢谢你的头发 你忘了添加混合器。 尝试 gst-lau