WinForm应用程序和WPF应用程序中的差异 [英] Difference in WinForm Application and WPF Application

查看:394
本文介绍了WinForm应用程序和WPF应用程序中的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这里有有趣的问题.
我使用此代码

Hi Guys,

There is interesting problem down here.
I use this code

If My.User.CurrentPrincipal.IsInRole("Administrators") Then
      MsgBox("Administrator")
    Else
      MsgBox("Not Administrator")
End If


在具有以下规格的两个不同的应用程序中:
1. 带有.NET Framework 3.5(VB.NET)的Windows窗体应用程序
2. 使用.NET Framework 3.5(VB.NET)的WPF Windows应用程序

在WinForm应用程序中,它在消息框中显示管理员.但是,在WPF中,它显示不是管理员.
这背后的原因是什么?有什么主意吗?
谢谢,

问候,
Itz.Irshad


in two different applications with below specs:
1. Windows Form Application with .NET Framework 3.5 (VB.NET)
2. WPF Windows Applciation with .NET Framework 3.5 (VB.NET)

In WinForm app it shows Administrator in Message Box. But, in WPF it shows Not Administrator.
What is reason behind this ? Any idea ?
Thanks,

Regards,
Itz.Irshad

推荐答案

除此之外,还存在其他差异.使用的显示技术对您发布的代码完全没有影响.
There is some other difference than this. The display technology used has no effect at all on the code you''re posting.


这篇关于WinForm应用程序和WPF应用程序中的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆