当我使用.NET framework 4.0 MSBUILD.EXE文件编译我的.csproj文件时,我收到的错误"lable01"在"website01.csproj"的当前上下文中找不到
实际上我需要添加每个ASP.NET页面及其Code Behind文件的引用,我已经完成了,它工作正常,但上面的错误正在等待.
我希望这意味着我需要在.csproj文件中添加表单名称"LABLE01",但我不知道语法.请大家为我提供在.csproj文件中添加表单名称的语法.
下面的示例使用我从代码中获取的BackupDirectories列表填充ItemsControl.
如何更改此设置以便从app.config文件中获取相同的信息?
XAML:
<Window x:Class="TestReadMultipler2343.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="160"/>
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
Text="Title:"/>
<TextBlock
Grid.Row="0"
Grid.Column="1"
Text="{Binding Title}"/>
<TextBlock
Grid.Row="1"
Grid.Column="0"
Text="Backup Directories:"/>
<ItemsControl
Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding BackupDirectories}"/>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
后台代码:
using System.Collections.Generic;
using System.Windows;
using System.Configuration;
using System.ComponentModel;
namespace TestReadMultipler2343
{
public partial class Window1 : Window, INotifyPropertyChanged
{
#region ViewModelProperty: Title
private string _title;
public string Title
{
get …Run Code Online (Sandbox Code Playgroud) 我想在postgres图像中使用psql,以便在数据库上运行一些查询.但不幸的是,当我附加到postgres容器时,我得到了错误,找不到psql命令...
对我来说,如何在容器中运行postgre sql查询或命令是一个谜.
如何在postgres容器中运行psql命令?(我是Docker世界的新人)
我使用Ubuntu作为主机,我没有在主机上安装postgres,我使用postgres容器代替.
docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------
yiialkalmi_app_1 /bin/bash Exit 0
yiialkalmi_nginx_1 nginx -g daemon off; Up 443/tcp, 0.0.0.0:80->80/tcp
yiialkalmi_php_1 php-fpm Up 9000/tcp
yiialkalmi_postgres_1 /docker-entrypoint.sh postgres Up 5432/tcp
yiialkalmi_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp
Run Code Online (Sandbox Code Playgroud)
这里的容器:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
315567db2dff yiialkalmi_nginx "nginx -g 'daemon off" 18 hours ago Up 3 hours 0.0.0.0:80->80/tcp, 443/tcp yiialkalmi_nginx_1
53577722df71 yiialkalmi_php "php-fpm" 18 hours ago Up 3 hours 9000/tcp yiialkalmi_php_1
40e39bd0329a postgres:latest "/docker-entrypoint.s" 18 …Run Code Online (Sandbox Code Playgroud) 我收到一个错误说
不推荐使用:与其类同名的方法将不会是PHP未来版本中的构造函数; TSStatus在第10行的C:\ Program Files(x86)\ Zend\Apache24\htdocs\viewer\modules\tsstatus\tsstatus.php中有一个弃用的构造函数
类TSStatus是底部TSStatus显示的第10行加
class TSStatus
{
private $_host;
private $_queryPort;
private $_serverDatas;
private $_channelDatas;
private $_userDatas;
private $_serverGroupFlags;
private $_channelGroupFlags;
private $_login;
private $_password;
private $_cacheFile;
private $_cacheTime;
private $_channelList;
private $_useCommand;
private $_javascriptName;
private $_socket;
public $imagePath;
public $showNicknameBox;
public $timeout;
public $hideEmptyChannels;
public $hideParentChannels;
public function TSStatus($host, $queryPort)
...
}
Run Code Online (Sandbox Code Playgroud) 我现在在mongodb Atlas上自由地创建并创建了集群,我现在想知道如何使用robomongo创建数据库并连接到它?
我想在用户滚动到表格底部时加载更多数据并创建其他单元格.我正在使用JSON数据和MySql.
func dataJsonFromURL(url:String)->NSArray
{
if let data = NSData(contentsOfURL: NSURL(string: url)!) {
return ((try! NSJSONSerialization.JSONObjectWithData(data, options: [])) as! NSArray)
}
else{
return data
}
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("NCell", forIndexPath: indexPath) as! TableViewCell22
cell.backgroundColor = UIColor .clearColor()
let mindata = (data[indexPath.row] as! NSDictionary)
}
Run Code Online (Sandbox Code Playgroud) 假设我有一个所有的列表Projects,并且我将它们分组为Category:
var projectsByCat = from p in Projects
group p by p.Category into g
orderby g.Count() descending
select new { Category = g.Key, Projects = g };
Run Code Online (Sandbox Code Playgroud)
现在我想将其显示为网页中的列表,首先我创建左侧div,其次是右侧div.我按Projects每个号码排序Category以显示Categories最多的Projects- 因此我想分成projectsByCat两部分 - 如果我把所有"奇数编号" Categories放在左边而"偶数编号"类别放在右边,我我想我会得到一个相当理智的观点.
所以我认为我可以做到这一点,以获得奇数和偶数成员projectsByCat:
var oddCategories = projectsByCat.Where((cat, index) => index % 2 != 0);
var evenCategories = projectsByCat.Where((cat, index) => index % 2 == 0);
Run Code Online (Sandbox Code Playgroud)
它编译 - 然而,当我运行它时,我得到一个例外,如下所示:
用于查询运算符'Where'的不支持的重载.
我认为自从它首先编译后我就安全了.;)
有一种优雅的方式来做到这一点?而且,是否有一个优雅的解释为什么我的创造性使用Where()不起作用? …
我想出了一个定义一个通用比较运算符的想法,它可以用于任何类型,以获得它的乐趣.
#include <cstring>
#include <iostream>
class A
{
public:
A(int id) : id(id) {}
private:
int id;
};
template <class T>
inline bool operator==(const T& a, const T& b)
{
return memcmp(&a, &b, sizeof(a)) == 0; // implementation is unimportant (can fail because of padding)
}
int main()
{
std::cout << (A(10) == A(10)) << std::endl; // 1
std::cout << (A(10) == A(15)) << std::endl; // 0
}
Run Code Online (Sandbox Code Playgroud)
我认为这可以用来解决c ++中缺少默认比较运算符的问题.
这是一个糟糕的主意吗?我想知道在某些情况下这样做是否会破坏任何东西?
我想与USB端口通信.如何找到我的USB设备(Weingscale)?
public static UsbDevice MyUsbDevice;
#region SET YOUR USB Vendor and Product ID!
public static UsbDeviceFinder MyUsbFinder =
new UsbDeviceFinder(0x15D9, 0x8A4C); // specify vendor, product id
#endregion
public static void Main(string[] args)
{
ErrorCode ec = ErrorCode.None;
try
{
// Find and open the usb device.
MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder);
// If the device is open and ready
if (MyUsbDevice == null) throw new Exception("Device Not Found.");
// If this is a "whole" usb device (libusb-win32, linux libusb)
// it will …Run Code Online (Sandbox Code Playgroud) c# ×4
.net ×1
app-config ×1
asp.net ×1
atlas ×1
c++ ×1
docker ×1
generics ×1
html5 ×1
html5-canvas ×1
itemscontrol ×1
javascript ×1
linq ×1
mongodb ×1
php ×1
postgresql ×1
robo3t ×1
svg ×1
swift ×1
uitableview ×1
wpf ×1
xcode ×1