小编Bay*_*len的帖子

如何将控制台输出添加到 windows wpf 应用程序 C#

我想添加一个额外的控制台窗口来记录我的 wpf 应用程序中的 Realtine 信息。任何的想法??

巴约

答案: 项目属性中的控制台应用程序对我有用。谢谢

c# wpf windows-console

8
推荐指数
2
解决办法
8940
查看次数

为什么这个反汇编的代码不能用C#编译?

我从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)

c# reflector cil module

2
推荐指数
1
解决办法
714
查看次数

用C#解释这个python表达式

这个python表达式的C#等价物是什么?

file_no = int (last_file.Name.Replace(last_file.Extension,"")[-3:]);
Run Code Online (Sandbox Code Playgroud)

我明白什么[-3:],但不是(int)演员.

c# python ironpython

1
推荐指数
1
解决办法
130
查看次数

什么是这个ironpython代码的C#版本

我需要在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#与以下表达式等效:

  • re.compile(...)...
  • 应用re.sub(...)...

c# regex ironpython

1
推荐指数
1
解决办法
656
查看次数

即使在 RenderOptions.SetBitmapScalingMode 到 HighQuality 之后,我的图像质量仍然很低

即使在 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)

在此处输入图片说明

c# render .net-4.0 bitmapimage

-1
推荐指数
1
解决办法
4329
查看次数