我需要在班上有一些代表.
我想使用界面"提醒"我设置这些代表.
如何?
我的班级看起来像这样:
public class ClsPictures : myInterface
{
// Implementing the IProcess interface
public event UpdateStatusEventHandler UpdateStatusText;
public delegate void UpdateStatusEventHandler(string Status);
public event StartedEventHandler Started;
public delegate void StartedEventHandler();
}
Run Code Online (Sandbox Code Playgroud)
我需要一个界面来强制这些代表:
public interface myInterface
{
// ?????
}
Run Code Online (Sandbox Code Playgroud) 我写了一个看起来像这样的代码:
Thread t = new Thread(() => createSomething(dt, start, finish) );
t.Start();
Run Code Online (Sandbox Code Playgroud)
它有效(有时几乎感觉有多个线程).
但我不使用任何代表.
我非常喜欢MDI应用程序.
它允许我在窗口之间快速移动并比较不同窗口的内容.此外,有时一个窗口的内容对另一个窗口的内容很有用,所以我可以复制和粘贴.我认为这对于工作模式来说是一种很棒的用户体验.
对错练习,我喜欢它.
我在WPF中看到Stack Overflow问题MDI应用程序,并在那里以Visual Studio 2010环境为例.我不明白是否以及如何实现该环境:比如有可以撕下独立屏幕的标签(对我来说不那么重要),并与其他标签并排重新排列.
我想我正在寻找"WPF中的对接布局系统",谷歌这个提供第三方组件.
我想我会从一个"正常"的应用程序开始.感觉就像这里没有简单的开箱即用的实现.
以下代码适用于上传文本文件,但无法上传JPEG文件(不完全 - 文件名很好但图像已损坏):
private void up(string sourceFile, string targetFile)
{
try
{
string ftpServerIP = ConfigurationManager.AppSettings["ftpIP"];
string ftpUserID = ConfigurationManager.AppSettings["ftpUser"];
string ftpPassword = ConfigurationManager.AppSettings["ftpPass"];
//string ftpURI = "";
string filename = "ftp://" + ftpServerIP + "//" + targetFile;
FtpWebRequest ftpReq = (FtpWebRequest)WebRequest.Create(filename);
ftpReq.Method = WebRequestMethods.Ftp.UploadFile;
ftpReq.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
StreamReader stream = new StreamReader(sourceFile);
Byte[] b = System.Text.Encoding.UTF8.GetBytes(stream.ReadToEnd());
stream.Close();
ftpReq.ContentLength = b.Length;
Stream s = ftpReq.GetRequestStream();
s.Write(b, 0, b.Length);
s.Close();
System.Net.FtpWebResponse ftpResp = (FtpWebResponse)ftpReq.GetResponse();
MessageBox.Show(ftpResp.StatusDescription);
}
catch (Exception ex) …
Run Code Online (Sandbox Code Playgroud) 我看到了如何在RichTextBox类中设置WPF富文本框.
但我喜欢在Windows Forms中将其文本保存到数据库中.
string myData = richTextBox.Text;
dbSave(myData);
Run Code Online (Sandbox Code Playgroud)
我该怎么做?
我从模板中创建了一个新项目:
IPhoneOS>应用程序>标签栏应用程序.
我有两个标签.
如何让第二个成为隐藏标签栏甚至状态栏的全屏?
我试图检查"想要全屏" - 但它没有帮助.
(不那么重要......当我得到一个全屏幕时,我会回来吗?)
请给我一个简单的代码/指南或对它们的引用,因为我是初学者 - 而且我和编译器有太多的问题让事情变得更糟
谢谢阿萨夫
我想使用xml文件
<pics>
<pic no="1">c:\pic1.jpg</pic>
<pic no="2">c:\pic2.jpg</pic>
<pic no="3">c:\pic3.jpg</pic>
<pic no="4">c:\pic4.jpg</pic>
<pic no="5">c:\pic5.jpg</pic>
....
</pics>
Run Code Online (Sandbox Code Playgroud)
在html表中:
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td><img src="" width="150" height="120" /></td>
<td><img src="" width="150" height="120" /></td>
<td><img src="" width="150" height="120" /></td>
</tr>
<tr>
<td><img src="from xml" width="150" height="120" /></td>
<td><img src="from xml" width="150" height="120" /></td>
<td><img src="from xml" width="150" height="120" /></td>
</tr>
<tr>
<td><img src="from xml" width="150" height="120" /></td>
<td><img src="from xml" width="150" height="120" /></td>
<td><img src="from xml" width="150" height="120" /></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
什么是最好的方法呢?
我需要一个程序来检查是否将新文件夹/文件添加到给定的选定文件夹中.我需要这个程序在应用程序启动时运行,因此这个阶段的处理时间很重要.
我想我可以记录当前状态,以前状态的日志,排序和比较它们.
首先,我需要知道是否还有其他方法.
第二,如果没有其他方法,找到两个文件路径列表之间的差异的最佳方法是:结构和算法.
旧州:
c:\firstfolder\a.doc
c:\firstfolder\b.doc
c:\firstfolder\secondFolder\a.doc
c:\firstfolder\secondFolder\b.doc
Run Code Online (Sandbox Code Playgroud)
新州:
c:\firstfolder\a.doc
c:\firstfolder\b.doc
c:\firstfolder\secondFolder\a.doc
c:\firstfolder\secondFolder\b.doc
c:\firstfolder\secondFolder\c.doc
Run Code Online (Sandbox Code Playgroud)
我在找c:\firstfolder\secondFolder\c.doc
.
我必须承认,我从来不知道流是什么 - 我一直以为这是互联网的事情.但是现在我遇到了一个使用流来加载文件的代码,我想知道是否有使用流的优势......以及我总是加载文件的方式:
private void loadingfromStream()
{
DirectoryInfo dirInfo = new DirectoryInfo("c:/");
FileInfo[] fileInfoArr = dirInfo.GetFiles();
FileInfo fileInfo = fileInfoArr[0];
// creating a bitmap from a stream
FileStream fileStream = fileInfo.OpenRead();
Bitmap bitmap = new Bitmap(fileStream);
Image currentPicture = (Image)bitmap
}
Run Code Online (Sandbox Code Playgroud)
与
private void loadingUsingImageClass
{
Image currentPicture = Image.FromFile(originalPath);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 wpf 数据网格中显示数据表的内容
在以下帖子中:
为什么我不能将 WPFToolkit DataGrid ItemSource 绑定到 DataTable?
我找到了代码:
myDataGrid.ItemsSource = myDataTable.DefaultView;
Run Code Online (Sandbox Code Playgroud)
并且行为很奇怪:它显示 n 个空行,其中 n 是正确的:查询结果 n 行!
那为什么我看不到他们呢?
c# ×5
wpf ×3
delegates ×2
algorithm ×1
datagrid ×1
diff ×1
encoding ×1
file ×1
filestream ×1
filesystems ×1
fromfile ×1
ftp ×1
html ×1
image ×1
interface ×1
iphone ×1
javascript ×1
loading ×1
mdi ×1
objective-c ×1
path ×1
richtextbox ×1
xslt ×1