首席开发人员表示,当他使用我的应用程序时,当他通过方向箭头键在TableLayoutPanel上的TextBoxes之间移动时,他的键盘会发出蜂鸣声.
但是,我听不到这种听觉活动.
这是我的代码:
// Had to intercept Up and Down arrows from Windows
private void textBoxPlatypi_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) {
TextBox tb = (TextBox)sender;
if (e.KeyCode.Equals(Keys.Up)) {
SetFocusOneRowUp(tb.Name);
return;
}
if (e.KeyCode.Equals(Keys.Down)) {
SetFocusOneRowDown(tb.Name);
return;
}
}
private void textBoxPlatypi_KeyDown(object sender, KeyEventArgs e) {
TextBox tb = (TextBox)sender;
if (e.KeyCode.Equals(Keys.Left)) {
SetFocusOneColumnBack(tb.Name);
e.Handled = true;
return;
}
if (e.KeyCode.Equals(Keys.Right)) {
SetFocusOneColumnForward(tb.Name);
e.Handled = true;
return;
}
}
Run Code Online (Sandbox Code Playgroud)
..他想也许我需要"e.Handled",但这在PreviewKeyDown事件中不可用.
有没有办法抑制哔哔声(这显然只发生在某些键盘或特定设置上(他使用的是Windows7,我还在使用XP))?
我现在有了这个代码:
private void textBoxPlatypus1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) {
switch (e.KeyCode) …Run Code Online (Sandbox Code Playgroud) 我在标题中有一个锚标记,我试图在锚标记上放置一个边框底部,这有效,但是底部的填充太大而负填充不起作用,我该如何解决这个问题呢?
直播现场
HTML
<div id="featureText">
<h1>Recent Works / <a href="#">All</a></h1>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#featureText a {
color: #414042;
text-decoration: none;
border-bottom: solid 2px #414042;
padding-bottom: -2px; }
Run Code Online (Sandbox Code Playgroud) 我动态构建的一些img元素可能(do)失败.对于这些情况,我从这里得到了一些代码:有没有办法以编程方式确定图像链接是坏的?即:
function getNatlBookCritics() {
var htmlBuilder = '';
// Doesn't do diddly-squat - wrong spot for it?
$('img').error(function () {
$(this).attr("src", "Content/NoImageAvailable.png");
});
$.getJSON('Content/NBCCJr.json', function (data) {
$.each(data, function (i, dataPoint) {
. . .
Run Code Online (Sandbox Code Playgroud)
......但它不起作用.Warum nicht?
将此代码放在$ .getJSON()调用的.each部分中:
var jObject = $('<img src=\"' + dataPoint.imghref + '\"/>');
$(jObject).error(function () {
$(this).attr("src", "Content/NoImageAvailable.jpg");
});
Run Code Online (Sandbox Code Playgroud)
...... 所有图像都失败了.dataPoint.imghref包含以下值:
http://www.amazon.com/exec/obidos/ASIN/B00655KLOY/garrphotgall-20
Run Code Online (Sandbox Code Playgroud)
在一个坚果地狱,我正在添加"img src",如下所示:
function getNatlBookCritics() {
var htmlBuilder = '';
$.getJSON('Content/nbcc.json', function (data) {
$.each(data, function (i, dataPoint) { …Run Code Online (Sandbox Code Playgroud) 我有这样的锚标签:
<a href=\"http://www.duckbill.com" target=\"_blank\"><img height=\"160\" width=\"160\" src=\"http://images.duckbill.com/PlatypiOnVacation.jpg\" alt=\"Platypi playing Pinochle and eating Pizza in Panama\" /></a>
Run Code Online (Sandbox Code Playgroud)
...有时无法加载src图像; 在这种情况下,我想在经过足够的延迟(几秒钟)后,将其替换为:
<a href=\"http://www.duckbill.com" target=\"_blank\"><img height=\"160\" width=\"160\" src=\"Content/Images/PlatypiOnVacation.jpg\" alt=\"Platypi playing Pinochle and eating Pizza in Panama\" /></a>
Run Code Online (Sandbox Code Playgroud)
我知道我可以在jQuery中做到这一点,但是我怎么能够以编程方式确定远程文件没有加载,在这种情况下,使用回退图像进行响应?
我喜欢Brad Christie对真正不可用的图像的回答,但我想永远不要显示"不可用" - 如果目前还没有远程的那个,只需使用本地的.我喜欢这个:http://www.cirkuit.net/projects/jquery/onImagesLoad/example1.html但是如何以编程方式确定图像失败?
在加载我的ASP.NET应用程序/站点时,我得到了这个错误信息:"遇到异常.这可能是由扩展引起的."
然后它说看这个文件:
C:\ Users \用户克莱\应用程序数据\漫游\微软\ VisualStudio的\ 11.0\ActivityLog.xml
...我确实找到了可能与问题有关的三个条目,但它们是"希腊语".由于它们的大量,我只是在这里包括第一个:
<entry>
<record>676</record>
<time>2013/10/22 13:52:50.109</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error, with 2 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.

1) The export 'Microsoft.VisualStudio.Shell.SVsServiceProvider' is not assignable to type 'System.Void'.

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager.VsServiceProvider (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager'.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager.VsServiceProvider (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager'.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager

Resulting in: Cannot …Run Code Online (Sandbox Code Playgroud) 我添加了我认为必要的SQLite(和sqlite-net)包到我的应用程序.但是,在运行它时,我得到一个例外:
System.DllNotFoundException未被用户代码处理HResult = -2146233052消息=无法加载DLL的'sqlite3':找不到指定的模块.(例外
我安装了以下SQLite包:

缺什么?
我尝试了ajawad987的建议,但仍然得到相同的运行时错误,即使我有这个:

...还有这个:

发生这个运行时异常的地方(在SQLite.cs中)对我来说似乎很奇怪:
var r = SQLite3.Open (databasePath, out handle, (int)openFlags, IntPtr.Zero);
Run Code Online (Sandbox Code Playgroud)
// open using the byte[]
// in the case where the path may include Unicode
// force open to using UTF-8 using sqlite3_open_v2
var databasePathAsBytes = GetNullTerminatedUtf8 (DatabasePath);
var r = SQLite3.Open (databasePathAsBytes, out handle, (int) openFlags, IntPtr.Zero);
Run Code Online (Sandbox Code Playgroud)
但是我正在使用C#,那么为什么线路甚至无法运行呢?(它在"else"块中失败了)?
Chrome是我首选的浏览器; 但是,我需要与SQL Server Reporting Services进行交互,当我导航到使用Report Builder(*.rdl文件)创建的报表时,在Chrome中我没有上下文菜单.当鼠标悬停在报告上时,它会"亮起"(在它周围绘制一个黄色边框),并在NE角落出现一个下拉箭头,但点击它不会做任何事情.
在IE中,它工作得很好.但是,如果我不需要,我真的不想使用IE.
Sharepoint有类似的问题(在Chrome和Firefox中无法完成的事情在IE中运行良好).我是否只需要"咬紧牙关"并在与Microsoft产品接口时使用IE,或者是否有办法从Chrome使用SSRS?
google-chrome reportbuilder cross-browser rdl reporting-services
我希望能够检索给定地址的地理坐标(纬度和经度)。如果我有完整的地址(街道地址 + 城市 + 州 + 邮政编码),我希望我能做到这一点。
如果重要的话,我正在使用 Bing 地图。我得到的骨架代码是这样的(fullAddress、AddPushpin() 和 getGeoCordsForAddress() 是最相关的部分):
private void btnSave_Click(object sender, EventArgs e)
{
string fullAddress = string.Empty;
if (MissingValues()) return;
mapName = cmbxMapName.SelectedItem.ToString();
locationName = txtbxLocation.Text;
address = txtbxAddress.Text;
city = txtbxCity.Text;
st8 = txtbxSt8.Text;
zip = txtbxZip.Text;
mapDetailNotes = richtxtbxMapNotes.Text;
fullAddress = string.Format("{0} {1} {2} {3}", address, city, st8, zip);
if (InsertIntoCartographerDetail())
{
MessageBox.Show("insert succeeded");
AddPushpin(fullAddress);
ClearControls();
}
else
{
MessageBox.Show("insert failed");
}
}
private void AddPushpin(string fullAddress)
{
GeoCoordinate geoCoord = …Run Code Online (Sandbox Code Playgroud) 我使用此指南将Web API应用程序升级到funkelnagelneu版本:
然而,在完成这些步骤之后(似乎所有这些都应该是自动化的,无论如何),我试图运行它并得到," 无法直接启动具有类库的输出类型的项目 "
什么Sam Hills Brothers Coffee正在这里发生什么?谁说这是一个班级图书馆?
所以我打开了Project> Properties,并对其进行了更改(由于某种原因,它被标记为"类库" - 它要么不是昨天,要么工作正常)到"Windows应用程序"的输出类型("控制台应用程序")和"类库"是唯一的其他选项).
现在它不会编译,抱怨:" 程序'c:\ Platypus_Server_WebAPI\PlatypusServerWebAPI\PlatypusServerWebAPI\obj\Debug\PlatypusServerWebAPI.exe'不包含适用于入口点的静态'Main'方法...... "
鉴于这种困境,如何让我的Web API应用程序重新启动并运行?
查看packages.config,两个条目看起来很划伤:
<package id="Microsoft.AspNet.Providers" version="1.2" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
Run Code Online (Sandbox Code Playgroud)
所有其他人都以net451为目标.这可能是问题吗?我应该删除这些包吗?
我尝试通过NuGet包管理器卸载Microsoft.Web.Infrastructure包(它的描述让我相信我不需要它;而且,它没有依赖性),但它告诉我," NuGet无法安装或卸载以下项目中的选定包.[我的] "
我再次走了几步,发现我错过了一步.我不得不在Application web.config文件中更改此条目:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
(从"4.0.0.0"到"5.0.0.0")
...但我仍然得到相同的结果 - 它重建/编译,但不会运行," 具有类库的输出类型的项目无法直接启动 "
考虑到错误信息,它不能直接打开一个类库,我想,"当然你不能/不会 - 这是一个网络应用程序,而不是一个项目.所以我跟着预感,关闭了项目,并重新打开它作为一个网站(而不是重新开放项目).
这让我更进一步,至少; 现在我看到了一个YSOD:
无法加载文件或程序集'System.Web.WebPages.Razor,Version = 3.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.该系统找不到指定的文件.
注意:该项目现在(在作为网站打开后)名为"localhost_48614"
并且...不再有"引用"文件夹......?!?!?
至于那个YSOD,我正在获得官方指示(http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api -project-to-aspnet-mvc-5-and-web-api-2)说这样做,我引用:
" …
我有一些我想从App.xaml中的代码访问的字符串,如:
<Application.Resources>
<ai:TelemetryContext x:Key="ApplicationInsightsBootstrapper" xmlns:ai="using:Microsoft.ApplicationInsights"/>
<ResourceDictionary x:Key="rd">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="GlobalStylesResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Application-specific resources. -->
<x:String x:Key="AppName">Platypus</x:String>
<x:String x:Key="BingMapsNamespace">http://schemas.microsoft.com/search/local/ws/rest/v1</x:String>
</ResourceDictionary>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
我想以编程方式获取这些值,所以我编写了这个实用程序函数:
internal static String GetResourceString(String keyStr)
{
var resldr = new Windows.ApplicationModel.Resources.ResourceLoader();
return resldr.GetString(keyStr);
}
Run Code Online (Sandbox Code Playgroud)
但如果失败," 在Platypus.exe WinRT信息中发生了'System.Exception'类型的第一次机会异常:找不到ResourceMap. "
我以为我在这里找到了问题的解决方案,据说这样做的方式已被弃用,我应该这样做:
internal static String GetResourceString(String keyStr)
{
try
{
//var resldr = new Windows.ApplicationModel.Resources.ResourceLoader();
//return resldr.GetString(keyStr);
var resldr = ResourceLoader.GetForCurrentView();
return resldr.GetString(keyStr);
}
catch (Exception ex)
{
Debug.WriteLine("Something wrong with the keyStr? Exception in GetResourceString(): {0}", ex.Message);
} …Run Code Online (Sandbox Code Playgroud) c# resourcedictionary app.xaml winrt-xaml windows-store-apps
c# ×4
asp.net ×2
html ×2
jquery ×2
winforms ×2
wpf ×2
app.xaml ×1
arrow-keys ×1
beep ×1
bing-maps ×1
border ×1
css ×1
geo ×1
header ×1
javascript ×1
keyeventargs ×1
nugetgallery ×1
padding ×1
razor ×1
rdl ×1
sqlite ×1
upgrade ×1
winrt-xaml ×1