好的,我有:
Visual Studio 2010 RC,W7 x64,启动了一个新的项目类型的Silverlight应用程序.在ASP.NET Web应用程序项目中托管Silverlight应用程序.Silverlight版本3.0.添加了LinqToSQL类,WCF服务,Winform Tester应用程序(解决方案中的项目)和一些类(也作为解决方案中的项目).
昨天,我突然得到了'断点不会被击中.此文档未加载任何符号.消息出现在IDE中,但它只影响Web Appliaction,我可以调试Silverlight和Winform App.
我尝试/做了什么来消除这个消息:
所以,这发生在我生命中的第二次.上次我通过删除临时ASP.NET文件夹解决了它,但这次我需要你的帮助.
目前我正在使用TagLib Sharp,如@stackoverflow中的一篇帖子所述,用于读取mp3,flac,ogg和类似的多媒体文件中的id3-Tag ..现在我才意识到,id3v2(甚至v1)支持自定义标签但是我找不到在TagLib Sharp中读/写自定义标签的实现.有人知道支持自定义字段的库吗?
基督教
---更新20100422 ---
还在搜索..找到这个页面:
初步情况
我正在开发.NET Framework 4.0,C#,Winform Application.应用程序将在GridView中列出(并测试)WebServiceOperations(当前有60个DataRows => WebServiceOperations).
目的
我只需点击一下按钮即可测试/调用所有这些操作.每个操作都会创建一个类的新实例.在这个类中,我调用WebServiceOperation异步并等待结果.结果随后得到验证.使用委托和事件,整个代码可以顺利运行.
现在谈到挑战/问题:当点击该按钮时,我使用for循环(int i = 0; i <gridViewWsOperations.RowCount; i ++)=>换句话说,目前我正在对它们进行60次操作'同时'=>服务器同时处理60个请求超载,我得到超时.所以我需要以某种方式限制结束请求的数量,让我们同时说10.考虑一下,for循环(我必须将请求排入队列)与我将请求出列的方法(process_result事件)不在同一个线程中.我尝试使用ConcurrentQueue,因为这种类型的集合似乎是线程安全的.
链接
示例代码真的会有所帮助!
---这是我的解决方案/示例代码---
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.Threading;
namespace ConcurrentQueueSample
{
class Program
{
static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(3);
static void Main(string[] args)
{
System.Timers.Timer timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Interval = 1234;
timer.Enabled = true;
timer.Start();
for (int i = 0; i < 10; i++) new Thread(go).Start(i);
}
static …Run Code Online (Sandbox Code Playgroud) 我在Microsoft SQL Server 2008R2中有一个bigint字段填充了刻度线(单个刻度表示一百纳秒或一千万分之一秒.在一毫秒内有10,000个刻度.)
http://msdn.microsoft.com/en-us/library/system.datetime.ticks.aspx
我需要将所有记录的总和转换为Days:Hours:Minutes:Seconds:Milliseconds.
它适用于单个记录:
SELECT CONVERT(TIME, DATEADD(ms, duration/10000, 0)) FROM tblMediaFileProperties WHERE FileId = '6C0A849D-95B4-4755-A923-B9DD8F1AF23E'
Run Code Online (Sandbox Code Playgroud)
但如果使用以下内容对所有记录求和:
SELECT CONVERT(TIME, DATEADD(ms, SUM(duration/10000), 0)) FROM tblMediaFileProperties
Run Code Online (Sandbox Code Playgroud)
我得到一个:
将表达式转换为数据类型int的算术溢出错误.
我知道溢出来自CONVERT到数据类型TIME函数...
帮助表示感谢,谢谢!
好的,我必须导出REG_BINARY值并将它们存储在SQL中,稍后我需要将这些值转换为字符串..
是)我有的:
在c#中我将REG_BINARY读取为Byte []数据类型,如:
RegistryKey rk = Registry.CurrentUser.OpenSubKey ...
byte [] value = rk.GetValue("TheKey")
然后我使用以下方法将它存储到SQL VarBinary字段:
private void SqlStorePstFileInfo(List<PersonalFolderObject> listOfPstObjects, int? userComputerId)
{
using (var sqlConnection = new SqlConnection(GetConnectionString()))
{
sqlConnection.Open();
foreach (PersonalFolderObject pfo in listOfPstObjects)
{
string s = "INSERT INTO [InvPstFile] (UserComputerId, Name, Path, Size, OldRegBinary) VALUES(@UserComputerId, @Name, @Path, @Size, @OldRegBinary)";
using (SqlCommand sqlCmd = new SqlCommand(s, sqlConnection))
{
SqlParameter pUserComputerId = sqlCmd.Parameters.Add("@UserComputerId", SqlDbType.Int);
pUserComputerId.Value = userComputerId;
SqlParameter pName = sqlCmd.Parameters.Add("@Name", SqlDbType.NVarChar);
pName.Value = pfo.Name;
SqlParameter pPath = …Run Code Online (Sandbox Code Playgroud) 我有一个在.NET 4.0/VS.NET 2010 C#中编写的Outlook 2010加载项.加载项扩展了Ribbon =>它添加了一个RibbonTab带有4个RibbonButtons(RibbonType属性设置为)Microsoft.Outlook.Explorer和Microsoft.Outlook.Mail.Read.
现在,如果用户单击其中一个RibbonButtons,我如何确定用户是否单击了添加到Microsoft.Outlook.ExplorerOR 的按钮Microsoft.Outlook.Mail.Read?
我需要使用 PowerShell 脚本将 Json 主体 HttpPost 发送到 ASP.NET Core Web Api 端点(控制器)。
$CurrentWindowsIdentity = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$CurrentPrincipalName = $CurrentWindowsIdentity.Identity.Name
# Build JSON payload
$JsonString = @"
{
"CurrentPrincipalName":"$CurrentPrincipalName"
}
"@
$response = Invoke-RestMethod -Uri "https://webapiendpoint.tld/api/somecontroller" -Method Post -Body $JsonString -ContentType "application/json"
Run Code Online (Sandbox Code Playgroud)
由于变量 $CurrentPrincipalName 的值可以是域\用户名,由于反斜杠未正确转义,json get 无效。
web api 的日志中的错误:
JSON input formatter threw an exception: 'C' is an invalid escapable character within a JSON string. The string should be correctly escaped. Path: $.CurrentPrincipalName | LineNumber: 15 | BytePositionInLine: 36.
System.Text.Json.JsonException: …Run Code Online (Sandbox Code Playgroud)