小编Bri*_*thy的帖子

如何修复错误:"无法通过创建架构找到属性/元素的架构信息"

我有一个使用C#在VS2010中编写的Windows窗体应用程序,并在app.config文件中获得以下错误:

Message 4   Could not find schema information for the attribute 'name'
Message 8   Could not find schema information for the attribute 'name'
Message 12  Could not find schema information for the attribute 'name'
Message 5   Could not find schema information for the attribute 'serializeAs'
Message 15  Could not find schema information for the element 'CCP_Utility.Settings1'
Message 2   Could not find schema information for the element 'CCP_Utility.Properties.Settings'
Message 3   Could not find schema information for the element 'setting' …
Run Code Online (Sandbox Code Playgroud)

c# error-handling application-settings database-schema

147
推荐指数
3
解决办法
20万
查看次数

如何导出私有/秘密ASC密钥解密Windows中的GPG文件

背景:我的老板尝试使用公共和私有部分向我输出ASC密钥,但每当我收到文件时,私有部分永远不会加载,它不会解密任何文件.

我们尝试使用以下方法导出ASC密钥:

  • Windows应用程序Kleopatra 2.1(包含在gpg4win中)
  • Windows应用程序GNU隐私助手(包含在gpg4win中)

            Error: "Decryption failed. Secret Key Not available." 
    
    Run Code Online (Sandbox Code Playgroud)

如何正确导出秘密或私有asc密钥来解密gpg文件?

encryption gnu gnupg private-key

83
推荐指数
7
解决办法
16万
查看次数

Visual Studio - 如何更改项目的文件夹名称和解决方案名称,而不是破坏解决方案

我正在创建一个基于旧项目的项目,因为它具有我需要使用的许多功能.我想重命名所有目录和解决方案名称以获得新项目的名称.在Documents\Visual Studio 2008\Projects下,我能够更改初始目录和解决方案文件名,但不能更改包含bin,obj和properties文件夹的子目录的名称.当我更改该子目录的名称时,打开解决方案时将不会打开任何文件.

如何在VS2008中更改项目的文件夹名称,以便它将所有文件作为解决方案的一部分加载并仍然有效?

visual-studio-2010 visual-studio-2008 visual-studio

81
推荐指数
2
解决办法
11万
查看次数

C#WinForms - 智能文本框控件,根据文本框宽度自动格式化路径长度

是否存在可以根据文本框宽度显示路径的智能文本框控件(WinForms).例如,如果路径很短,它将显示整个路径(C:\ myfile.txt),但如果路径很长,它将显示开始和结束(C:\ SomeFolder ...\foo\MyFile.txt ).显示的字符长度应由文本框使用其宽度(动态)计算.欢迎任何商业或开源建议.非常感谢你.

c# filenames textbox path winforms

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

VB.NET - 如何使用Active Directory将SID转换为组名

使用VB.NET,如何使用Active Directory将sid转换为组名?

例如:我需要获得"group_test"而不是"S-1-5-32-544"

我正在使用的代码是:

Public ReadOnly Property Groups As IdentityReferenceCollection
    Get

        Dim irc As IdentityReferenceCollection
        Dim ir As IdentityReference
        irc = WindowsIdentity.GetCurrent().Groups
        Dim strGroupName As String

        For Each ir In irc
            Dim mktGroup As IdentityReference = ir.Translate(GetType(NTAccount))
            MsgBox(mktGroup.Value)
            Debug.WriteLine(mktGroup.Value)
            strGroupName = mktGroup.Value.ToString

        Next

        Return irc

    End Get
End Property
Run Code Online (Sandbox Code Playgroud)

或类似的东西?

        currentUser = WindowsIdentity.GetCurrent()

        For Each refGroup As IdentityReference In currentUser.Groups

            Dim acc As NTAccount = TryCast(refGroup.Translate(GetType(NTAccount)), NTAccount)
            If AdminGroupName = acc.Value Then
                ret = "999"
            End If
            If UsersGroupName = …
Run Code Online (Sandbox Code Playgroud)

vb.net asp.net sid usergroups active-directory

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

ASP.NET - Web.config登录错误找不到存储过程'dbo.aspnet_CheckSchemaVersion'

我正在使用表单身份验证和gettnig以下错误:

'/'应用程序中的服务器错误.

找不到存储过程'dbo.aspnet_CheckSchemaVersion'.描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

异常详细信息:System.Data.SqlClient.SqlException:找不到存储过程'dbo.aspnet_CheckSchemaVersion'.

来源错误:

在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.

堆栈跟踪:

[SqlException(0x80131904):找不到存储过程'dbo.aspnet_CheckSchemaVersion'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,Boolean breakConnection)+2030802
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,Boolean breakConnection)+5009584
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()+234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)+2275
System.Data.SqlClient. SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,String resetOptionsString)+215
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,Boolean async)+987
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior) cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String method,DbAsyncResult result)+1 62
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result,String methodName,Boolean sendToPipe)+178
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()+137
System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider,SqlConnection连接) ,String [] features,String version,Int32&schemaVersionCheck)+392
System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection)+84
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username,Boolean updateLastLoginActivityDate,Int32&status,String&password ,Int32&passwordFormat,String&passwordSalt,Int32&failedPasswordAttemptCount,Int32&failedPasswordAnswerAttemptCount,Boolean&isApproved,DateTime&lastLoginDate,DateTime&lastActivityDate)+827
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,String password,Boolean updateLastLoginActivityDate,Boolean failIfNotApproved,String&salt,Int32& passwordFormat)+105
System.Web.Securit y.SqlMembershipProvider.ValidateUser(String username,String password)+106
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e)+60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)+129 System. Web.UI.WebControls.Login.AttemptLogin()127
System.Web.UI.WebControls.Login.OnBubbleEvent(对象源,EventArgs的)101 System.Web.UI.Control.RaiseBubbleEvent(对象源,EventArgs的参数)+ 37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)+125
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)+167
System.Web.UI.WebControls.Button.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String …

asp.net forms-authentication login web-config

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

ASP.NET - 使用WCF Web服务绑定w/AD组的IIS7部署错误500 24 50

背景:在部署在本地计算机上无错误编译的应用程序后,我收到内部服务器500 24 50错误.部署应用程序的服务器具有大量安全性并且运行IIS 7.5,因此我需要为每个目录指定读写访问权限.此应用程序使用Windows身份验证和Web服务通过代理填充下拉框.我认为连接到Web服务可能存在问题,或者文件的读/写安全性问题,或者活动目录身份验证存在问题.

由于某种原因,Internet Explorer刚刚显示无法加载网页错误.

Google Chrome中出错:

 500 – Internal Server Error.
 There is a problem with the resource you are looking for, and it cannot be displayed. 
Run Code Online (Sandbox Code Playgroud)

日志文件详情:

 #Software: Microsoft Internet Information Services 7.5
 #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken

 2011-05-18 13:54:46 W3SVC1 FL-TPA-WEB-01 172.17.1.25 GET / - 80 - 
 172.17.1.25 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;
 +Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET4.0C;+.NET4.0E) - -
 invitations.myagencyservices.com 500 24 50 1380 …
Run Code Online (Sandbox Code Playgroud)

asp.net wcf wcf-binding wcf-security iis-7.5

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

C# - 表单身份验证代码 - 自定义角色和成员资格提供程序

不幸的是,我在网上找到的自定义角色和成员提供商背后的表单身份验证代码的所有示例都是用VB.NET代码编写的,我需要一个C#代码.请帮忙!!!!

我需要一个代码隐藏,它将执行以下操作:

  • 登录按钮单击后验证用户
  • if user active_flag = 0(false)OR password!= @ password,显示错误:"Access Denied"
  • 如果用户admin_flag = 1&active flag = 1(true),则重定向到admin_pages\zipsearch.aspx
  • 如果用户admin_flag = 0(false)&active_flag = 1(true),则重定向到pages\zipsearch.aspx

Default.aspx代码:

    <asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false">
    <LayoutTemplate>
        <span class="failureNotification">
            <asp:Literal ID="FailureText" runat="server"></asp:Literal>
        </span>
        <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification" 
             ValidationGroup="LoginUserValidationGroup"/>
        <div class="accountInfo">
            <fieldset class="login">
                <legend>Account Information</legend>
                <p>
                    <asp:Label ID="usernameLabel" runat="server" AssociatedControlID="username">Username:</asp:Label>
                    <asp:TextBox ID="username" runat="server" CssClass="textEntry"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="username" 
                         CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                         ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="passwordLabel" runat="server" AssociatedControlID="password">Password:</asp:Label>
                    <asp:TextBox ID="password" runat="server" CssClass="passwordEntry" …
Run Code Online (Sandbox Code Playgroud)

c# asp.net forms-authentication roleprovider membership-provider

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

C#Visual Studio 2008 - Windows窗体设计器中的设计时错误

如何修复Windows窗体设计器中的设计时错误?

当我点击MyMainForm.cs [Design]页面调出WinForms时,我收到以下错误:

  To prevent possible data loss before loading the designer, the following errors must be resolved: 
  The class name '?' is not a valid identifier for this language.     

  Instances of this error (1)  

  1.   Hide Call Stack 

  at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.CodeTypeDeclarationFromCodeClass(CodeClass vsClass)
  at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnNamespacePopulateTypes(Object sender, EventArgs e)
  at System.CodeDom.CodeNamespace.get_Types()
  at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
  at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
  at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
  at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
  at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
  at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)  
Run Code Online (Sandbox Code Playgroud)

以下是我在MainForm.Designer.cs中的错误:

  Warning   1   The class name '?' is not a valid identifier for this …
Run Code Online (Sandbox Code Playgroud)

c# error-handling windows-forms-designer

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

C#Windows窗体 - 选择并复制多个文件w MultiSelect,OpenFileDialog和FileBrowserDialog

我正在使用带有OpenFileDialog和FileBrowserDialog的C#开发WinForms应用程序,我想:

  1. 启用多个xls文件的选择.
  2. 选择后,在文本框中显示选定的xlsx文件名
  3. 将所选文件复制到单独的目录Consolidated

我怎么能做到这一点?

.net c# openfiledialog file-browser multi-select

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