我尝试的方式通过标准的Windows.Forms实现它(获得valide DialogResult.OK)
System.Windows.Forms.SaveFileDialog dlg = new System.Windows.Forms.SaveFileDialog();
dlg.FileName = "Document"; // Default file name
// dlg.DefaultExt = ".jpg"; // Default file extension
dlg.Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif";
if(dlg.ShowDialog()== System.Windows.Forms.DialogResult.OK)
if (dlg.DialogResult.HasValue && splashDialog.DialogResult.Value)
{
string fName = dlg.FileName;
if (dlg.FileName != "")
{
System.IO.Stream fileStream = (System.IO.FileStream)dlg.OpenFile();
fileStream.Close();
}
}
Run Code Online (Sandbox Code Playgroud)
这是使用Windows窗体但它保存空白图像((
我试图将一些代码从目标c转换为非托管c ++我有这个操作
Buffer* ir =malloc( sizeof( Buffer ) );
Run Code Online (Sandbox Code Playgroud)
错误:表达式必须有指针类型?同样的错误进入这段代码
ir->buffer = malloc( bufferSize );
Run Code Online (Sandbox Code Playgroud)
能否请你malloc在这个非托管的c ++中正确使用它?
在c ++我有这样的功能
extern "C" _declspec(dllexport) uint8* bufferOperations(uint8* incoming, int size)
Run Code Online (Sandbox Code Playgroud)
我试图从c#这样调用它
[DllImport("MagicLib.DLL", CallingConvention = CallingConvention.Cdecl)]
//[return: MarshalAs(UnmanagedType.ByValArray)]//, ArraySubType=UnmanagedType.SysUInt)]
public static extern byte[] bufferOperations(byte[] incoming, int size);
Run Code Online (Sandbox Code Playgroud)
但我得到了无法编组'返回值':无效的托管/非托管类型组合
((问题是 - 如何正确编组?感谢您阅读我的问题
我有一个值,例如07-August-2012 09:30:00我的完整日期和时间DateTime,但是07.08.2012当我将其设置为此值时,我的infragistics ultra网格单元格中只会显示DateTime.
如何显示完整DateTime值?
我已经编写了一个控制台应用程序(带有main函数的.java类),并且我喜欢在执行我的BIG项目之前调用这个main(或者,例如一些静态方法)如何使用MAVEN(脚本?)?
这是我的xaml:
<ComboBox Name="comboColors">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="{Binding Name}" Width="16" Height="16" Margin="0,2,5,2" />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Run Code Online (Sandbox Code Playgroud)
这里是c#中的一组组合框:
comboColors.ItemsSource = typeof(Colors).GetProperties();
Run Code Online (Sandbox Code Playgroud)
现在的问题是 - 如何让这个组合在4-5-6或更多列的下拉列表中显示其项目?
另一个问题 - 如何为此下拉菜单插入标题?说"palett颜色是:"这是一个文本字段 - 不是一对颜色名称也许我可以添加透明颜色+标题作为第一个元素,但如何使它成为第一行?
可能是一个数据网格,因为下拉是一个很酷的主意?我现在试试吧)
我无法在View Model的SET属性中定位断点,因此默认值未更改.(获取 - 没问题,它使用有效的默认值初始化我的文本框.)
我有一个model.cs,其中定义了一个公共字符串字段
model.cs
{
..
public textDefValue = "aaa";
}
Run Code Online (Sandbox Code Playgroud)
这是一个ViewModel
{
..
Model model = new Model();
....
public string TextField
{
get { return model.textDefValue; }
set
{
//break point here
model.textDefValue = value;
RaisePropertyChanged(TextField);
}
}
....
protected void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
Run Code Online (Sandbox Code Playgroud)
和XAML:
<TextBox x:Name="myBox" Text="{Binding ViewModel.TextField, Mode=TwoWay}">
Run Code Online (Sandbox Code Playgroud)
我想当我在这个文本框中输入一些东西时,SET会起作用,我将针对一个断点但是,我无法在SET中击中这个中断.哪个错误?
我正在使用这段代码从文件中读取,但出现错误“无法创建抽象类或接口“System.IO.TextReader”的实例”
using (FileStream fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read))
using(TextReader reader = new TextReader(fileStream))//error
{
...
}
Run Code Online (Sandbox Code Playgroud) 我创建了一个具有注册操作的Web api控制器:
public class MyProjApiController : ApiController
{
public IHttpActionResult Register()
{
return RedirectToAction("Register", "AccountController"); //??
}
}
Run Code Online (Sandbox Code Playgroud)
我试图重定向到public class AccountController : Controller具有MVC控制器中的 另一个动作,public async Task<ActionResult> Register(RegVM model)但是我的Register动作MyProjApiController具有IHttpActionResult返回类型,而AccountController中的注册具有Task<ActionResult>类型-如何调用它?
我尝试从字符串中删除城市代码,我已经用indexOf编写了删除括号.如何用正则表达式做到这一点?
史密斯先生(344)455 66 44
至
史密斯先生455 66 44
是否有可能没有循环 - 如果我有一个字符串像:"ololo with=1 dddd with=2 blablabla"到"ololo with='1' dddd with='2' blablabla"?
抱歉这个问题,但我被困住了.我有下面的语法:
class xx
{
..some simple fields like: int t; // )))
public: class anotherClass;
xx();
MyObj* obj();
string* name(); //error C2143: syntax error : missing ';' before '*'
}
Run Code Online (Sandbox Code Playgroud)
我写了# include <string>
编译器想要什么?!
c# ×8
c++ ×3
wpf ×3
java ×2
string ×2
asp.net-mvc ×1
combobox ×1
dll ×1
filestream ×1
infragistics ×1
io ×1
malloc ×1
marshalling ×1
maven ×1
regex ×1
ultrawingrid ×1
unmanaged ×1
winforms ×1