在win8你可以
using Microsoft.Phone.Tasks;
PhoneCallTask phoneCallTask = new PhoneCallTask();
phoneCallTask.PhoneNumber = "2065550123";
phoneCallTask.DisplayName = "Gage";
phoneCallTask.Show();
Run Code Online (Sandbox Code Playgroud)
但在Win 10通用应用程序中,您必须使用
Windows.ApplicationModel.Calls;
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(PhoneNumber, DisplayName);
Run Code Online (Sandbox Code Playgroud)
在msdn开发网络中有一个PhoneCallManager类 https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phonecallmanager.aspx
但是当我添加Windows.ApplicationModel.Calls; 我不能使用PhoneCallManager,因为没有任何callmanager ..
我激活了电话呼叫功能.
Visual Studio 2015 Windows Universal APP c#XAML谢谢
I got this wierd error today and I can't solve it, obviously. I've created an entire ASP.NET API, which works just fine, no trouble. Now I want to add some MVC pages to the application. ASP.NET API automatically gives you one controller, (home controller) with the default asp.net page.
Now when I try to open this page, I browse to http://localhost:26264/home.
First I got the error with System.Web.MVC reference:
Could not load file or assembly 'System.Web.Mvc, Version=5.2.2.0... I solved …
我有一个非常简单的.NET Core Web应用程序(.NET Framework),使用Visual Studio 2015 Update 3创建,可以无错误地构建.
我可以使用x64配置文件在文件系统上发布.但是,当尝试使用目标运行时"win7-x86"发布时会出现以下错误:
找不到路径'c:\ Users\Developer\Documents\Visual Studio 2015\Projects\SelfHostTest\src\SelfHostTest\bin\Release \net452\win7-x86\SelfHostTest.exe'的一部分
我使用的是Windows 8.1 x64机器.我去了"配置管理器"并将"平台"从"任何CPU"更改为"x86"但是没有用.
我注意到有一个文件夹"src\SelfHost2\bin\Debug \net452\win7-x64",但我没有为x86创建一个结构.
此发布有效:
此发布不起作用:
这是我的project.json,以帮助别人帮助我.
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.Server.WebListener": "0.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"net452": {
"dependencies": {
}
}
},
"buildOptions": {
"emitEntryPoint": …Run Code Online (Sandbox Code Playgroud) asp.net-mvc publish asp.net-mvc-5 visual-studio-2015 asp.net-core
我正在尝试检查是否已分配数组中的结构,但无法检查它或者它的数据为空。有什么方法可以检查它是否已分配吗?
结构:
[StructLayout(LayoutKind.Explicit)]
public struct CharInfo
{
[FieldOffset(0)]
public CharUnion Char;
[FieldOffset(2)]
public short Attributes;
}
Run Code Online (Sandbox Code Playgroud)
方法
public void render(){
for (int i = 0; i < (width * height - 1); i++) {
if (screenBuffer[i].Char.UnicodeChar != Convert.ToChar(" ")) {
ScreenDriver.screenBuffer[i] = screenBuffer[i];
}
}
// ScreenDriver.screenBuffer = screenBuffer;
}
Run Code Online (Sandbox Code Playgroud) 我有一个ASP.NET应用程序,有两种语言可供选择:默认为英语,第二选项为葡萄牙语.
一切都很好,看看第一张图片:
然后,当我尝试添加或删除字符串资源时,visual studio在编译时开始给出歧义错误,如下所示:
命名空间'VolunteerGames.Web.Translations'已包含'翻译'的定义
和
'VolunteerGames.Web.Translations.Translation.ResourceManager'和'VolunteerGames.Web.Translations.Translation.ResourceManager'之间存在歧义
我注意到在更改了设计器(Translation.resx)中的资源之后,创建了一个名为Translation1.Designer.cs的新文件.它创建了另一个名为Translation的类.如果我删除这个新文件,我可以编译,但是当我尝试在我的控制器上使用时,找不到我刚刚创建的新字符串.
我无法理解发生了什么.我在这个项目中已经工作了几个月,这一切都很好.
我有一个必需的业务逻辑,应从PriceList表中获得产品价格.您可以在代码中看到查询的某些部分被重复.
我担心如何重用查询的某些部分:p.Sellers.Any(s => s.PersonId == personID)或者currentDate >= p.StartDate && currentDate <= p.EndDate例如.
var basicQuery = context.PriceList.Where(p => !p.Deleted);
// first search by product, salesman and date
var priceItem = basicQuery.FirstOrDefault(p => p.ProductId == productID &&
p.Sellers.Any(s => s.PersonId == personID) &&
currentDate >= p.StartDate &&
currentDate <= p.EndDate);
if(priceItem != null)
return priceItem;
priceItem = basicQuery.FirstOrDefault(p => p.ProductId == productID &&
currentDate >= p.StartDate &&
currentDate <= p.EndDate);
if(priceItem != null)
return priceItem;
priceItem …Run Code Online (Sandbox Code Playgroud) 我有一个简单的亲子模型
public class ApplicationTableAndFieldsViewModel
{
[Key]
[Required]
public int ParentTableID { get; set; }
[Required]
public string Description { get; set; }
public List<ApplicationTableField> ApplicationTableFields { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我将整个模型从控制器传递到视图没有问题:
public ViewResult Edit(int parentTableID)
{
ApplicationTableAndFieldsViewModel applicationTable = repository.ApplicationTablesVM
.FirstOrDefault(p => p.ParentTableID == parentTableID);
ViewBag.FieldTypeList = repository.FieldTypes;
IEnumerable<string> FieldTypeDrop = repository.FieldTypes;
List<SelectListItem> selectList = new List<SelectListItem>();
foreach (var c in FieldTypeDrop)
{
SelectListItem i = new SelectListItem();
i.Text = c;
i.Value = c;
selectList.Add(i);
}
ViewBag.FieldTypeList = selectList;
return …Run Code Online (Sandbox Code Playgroud) c# ×5
asp.net-mvc ×4
asp.net ×1
asp.net-core ×1
publish ×1
razor ×1
reference ×1
struct ×1
windows ×1