我想添加一个额外的控制台窗口来记录我的 wpf 应用程序中的 Realtine 信息。任何的想法??
巴约
答案: 项目属性中的控制台应用程序对我有用。谢谢
我从CIL到C#转换器(.Net反射器)恢复了以下类.不幸的是,VS2010不会编译它.知道如何让它工作吗?
using System;
using System.IO;
using System.Reflection;
internal class <Module>
{
static <Module>()
{
IPLRes.ExeDirectory = new FileInfo(Assembly.GetExecutingAssembly>>().Location).DirectoryName;
AppDomain expr_1E = AppDomain.CurrentDomain;
expr_1E.AssemblyResolve += new ResolveEventHandler(expr_1E.AssemblyNotFound);
IPLRes.LogDirectory = IPLRes.ExeDirectory + "\\log";
IPLMsg.Log("Loader", "Application starting...");
}
public static Assembly AssemblyNotFound(object A_0, ResolveEventArgs A_1)
{
string text = A_1.Name;
text = text.Remove(text.IndexOf(","));
text = IPLRes.ExeDirectory + "\\bin35\\" + text + ".dll";
return Assembly.LoadFile(text);
}
[STAThread]
public static void IPLMain(string[] A_0)
{
if (A_0.Length >= 1)
{
IPLRes.BatchMode = A_0[0].Contains("batch");
}
if (!IPLRes.BatchMode) …
Run Code Online (Sandbox Code Playgroud) 这个python表达式的C#等价物是什么?
file_no = int (last_file.Name.Replace(last_file.Extension,"")[-3:]);
Run Code Online (Sandbox Code Playgroud)
我明白什么[-3:]
,但不是(int)
演员.
我需要在C#中编写这个IronPython代码(我找不到类似的C#库来匹配IronPython的re模块):
for v in variables:
replace = re.compile(v, re.IGNORECASE)...
re.sub(v, str(self.SQLVariables[v.upper().replace("&","")]),script_content)...
Run Code Online (Sandbox Code Playgroud)
换句话说,C#与以下表达式等效:
即使在 RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality); 之后,我的图像质量仍然很低;任何的想法
if(File.Exists(image_file.FullName))
{
IPLRes.print( "Loading " + image_file.FullName);
BitmapImage thumbImg = new BitmapImage(new Uri(image_file.FullName));
RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality);
ImageBrush imgbrush = new ImageBrush(thumbImg);
imgbrush.Stretch = System.Windows.Media.Stretch.Uniform;
RenderedPages[page_numx] = imgbrush;
}
Run Code Online (Sandbox Code Playgroud)
.....
ShapRectangle thumbnail = (ShapRectangle)FindName("rect_Thumb" + thumbnail_nbr);
VISUAL thumbnailvisual = (VISUAL)FindName("rect_Thumb" + thumbnail_nbr);
thumbnail.Fill = (System.Windows.Media.Brush)RenderedPages[page_numx];
Run Code Online (Sandbox Code Playgroud)