|
This has popped up several times this week. It is rather annoying (not u, the problem )
You will need to do something like this depending on your databinding:
control.DataBindings[0].BindingManagerBase.EndCurrentEdit();
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
You're right two times in one answer:
1. This problem is REALLY annoying. )
2. This method works well - I have tested 3 different binding modes. There is just one small thing - it needs two more clicks on checkbox to "synchronize". Should I open the row for editing? I have tried to use BeginEdit() method on current row, but there was no difference. I think, that may be a point, but have no idea how to solve it.
Thanks for help
h.
|
|
|
|
|
how to do the following using .NET
I have the following XML document :
3.14159
If I were using COM MSXML parser, I could get
NodeTypedValue property to get "strongly-typed"
value.
b= XMLDocument.SelectSingleNode("//b");
variant value = b.NodeTypedValue;
//now the variant contains double value.
The question is:
how to achieve the same using C# ?
Value property of XMLNode object returns String
type, wchich i have to convert to get desired type...
How to do this without explicit conversion (by the means
of XMLConvert class or similar...)
Thanks
Michal Januszczyk
|
|
|
|
|
May be that's me but I believe that even with MSXML you are supposed to have a separate schema (with attributes of the form dt:type="int") to define node data types.
May be for usability reasons MS indeed allowed to put dt:type attributes along with Xml elements, but that of course didn't apply to define attribute data types since an attribute can hardly be data typed by another attribute.
It's not lost with the .NET Xml parser, just made different. The Xml schema has its own namespace and has the equivalent API you referred to, scattered in this namespace. For instance, System.Xml.Schema.XmlSchemaDatatype.ParseValue() .
PS : the .NET Xml parser is not a wrapper of the MSXML parser, which is a very good design decision. (at least something that stands for itself in this .NET run-time).
|
|
|
|
|
.S.Rod. wrote:
...(at least something that stands for itself in this .NET run-time).
Why Stephane, I haven't noticed your using that "smiley" before.
If I didn't know better, I'd say you are among those of us who have been wrestling with the insanity of the software industry for so long...
"Few are those who see with their own eyes and feel with their own hearts." - A. Einstein
|
|
|
|
|
A last funny pic before tonight's hunting,
|
|
|
|
|
I have to an applicatin that in part of it,it shows .zip files.In windows xp when I right click on zip files,I can choose EXTRACT ALL... option and unzip files.I want when I double click on zip files in my program it extract files,So I think I shoul use Procees.Start() and ProcessStartInfo .By default it only open .zip file with windows explorer so I have to set ProcessStartInfo.Verb property,but I don't know the action.I pass EXTRACT or EXTRACT ALL,and somethings like that but it always thrown exception.Does anybody know how can I find the these Verbs name or any idea about this problem?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I am afraid you are facing a shell extension handler. Exposed functions are called by Windows Explorer on the basis of registered components (see HKCR\.zip and HKCR\Directory\ShellEx for entry points), and use COM plumbering, not the command line.
|
|
|
|
|
Thanks for reply.
.S.Rod. wrote:
COM plumbering, not the command line.
Could you please give me more details?What is COM plumbering?You mean using ShellExecute() function?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
An insight[^] on COM plumbering for this particular Winzip case.
|
|
|
|
|
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi
I am running a small ActiveX Control (.NET UserControl exposed as ActiveX), connecting back to host server. This is an intranet application. And this ACtiveX Control refuses to connect back to host server, unless, I add it to 'Trusted Sites' Zone.
How to add the site automatically to Trusted Sites zone. I a have seen this with GotDotNet Workspace VSS-Like Control MSI Installation. Is'nt it?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
I hope this is not possible. If it is, that's a security flaw.
|
|
|
|
|
If you can access the registry, you can add an entry to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
Rocky Moore <><
|
|
|
|
|
Hi Rocky,
That's cool. But I have the following doubt regarding that. It just says ZoneMap/Domains but how does IE understand what domain it belongs too. Since there are 4 Security Zones right. We want our domain to be put in 'Trusted Sites' Zone.
But I had two sites in my Trusted Sites zone and when I searched for these domains in Registry, they were found at:
My Computer\HKEY_USERS\S-1-5-21-478445148-176170993-1538882281-1205\Software\Microsoft\Windows\CurrentVersion\Internet Settings
I could find subkeys for my sites that I have added as 'Trusted Sites'. But my doubt now is what is that
S-1-5-21-478445148-176170993-1538882281-1205 and how to dynamically intrepret this.
Since IE maintains Security Zones on a per-user/per-profile basis, right? Please advise...
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Deepak Kumar Vasudevan wrote:
But my doubt now is what is that
S-1-5-21-478445148-176170993-1538882281-1205 and how to dynamically intrepret this.
Thats the SID. Every user account has one. The currently logged on user should be mapped to current user in the registry.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Deepak Kumar Vasudevan wrote:
I could find subkeys for my sites that I have added as 'Trusted Sites'. But my doubt now is what is that
S-1-5-21-478445148-176170993-1538882281-1205 and how to dynamically intrepret this.
As Leppie mentioned that is the ID of the user, in the link I provided:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
It is based on the current user so the ID is not shown.
As you see from the folders you already have listed, they have a DWORD '*' which is (in my machine at least) value of 2. They ties to the folder name under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones
As long as you have entries in the previous key path (in the Domains), and that value you add under it has the value pointing back to the Zones folder (probably the value of 2), IE will classify that site as trusted.
Rocky Moore <><
|
|
|
|
|
Hi,
I want to read the PRoxy Settings from Microsoft Internet Explorer Control Panel Internet Applet Settings and use it for my System.Net.WebClient.
How and where can I read the Proxy/Port in C# application?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
My suggestion is to decompile the implementation from the System.Net.ProxyRegBlob class (System.dll). (for any reason, this class was made hidden).
Other suggestions :
- import wininet.dll API functions (InternetQueryOption)
- hack the registry (HKCR \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Connections + HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Connections).
|
|
|
|
|
.S.Rod. wrote:
My suggestion is to decompile the implementation from the System.Net.ProxyRegBlob class (System.dll). (for any reason, this class was made hidden).
Here's the source code: Net::ProxyRegBlob Class Reference[^]
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I'm trying to use a form I created in C# in a VC++ program I am creating. (Descriptive subject, no?) I have the C# compiling into a DLL and ... well that's about as far as I can get. I've done some reseach in the MSDN, and it shows how to use console classes, but nothing about how to use a form created in C#. I don't have the code on this computer, but the method I found I was trying last was using the following code (Close as I can 'member)
#using <mscordb.dll>//However main CLR dll is spelled.
#using "MyCSharpDLL.dll"
using namespace MyCSForm;//I tried it with and without this
//line and it didn't work either way, so I show it.
That's about where I get to. I also try to create an object of the class in the name space using either
MyForm Form1;
OR
MyCSForm::MyForm Form1;
Depending on if I use the "using namespace MyCSForm;" line or not.
I have also tried to using a slightly more complex method, one that is used to load functions from a DLL. I use that method to pull things out of a C++ dll that uses dllexport to say what comes out. That method can load the C# DLL but I can't figure out what I would be trying to load from it. Tried and failed to do the form, and main and even the namespace. None worked. At least I don't know how to get them to work.
Any help would be appreciated and if you have question I will answer them to the best of my abilities. And if I am going all wrong on how to load a DLL made in C# into C++, please point me in the right direction. Thanks.
Note: I'm sorry if I seem to be flooding the forum, but I'm not sure which of the three (Visual C++, Managed C++, C#) I am posting this in would be the best place for it. Since it deals with all three of them, I believe.
Thank you again for any help.
The wisest of the wise may err. - Aeschylus
|
|
|
|
|
You have several options :
- export the C# assembly to a COM component (regasm.exe) and use it from your VC++ program like a normal COM component. This article[^] (Nick Parker) tells how to.
- use MC++ mix mode, where your code references the namespace and class written with C#. #using <MyCSharp.dll> using namespace MyCSForm;, and of course you need to compile with VC++7.x with the /clr switch.
PS : cross-posting is lousy.
|
|
|
|
|
Dear All,
Please guide me how I can run my .NET application stored on another computer in my LAN from a mapped drive.
Regards,
Sassan Komeili Zadeh
|
|
|
|
|
I have a requirement to authenticate users against a non-MS LDAP service using non-standard attributes. The general method of doing this is to search for the user anonymously, then re-bind to the server with the found DN and the provided password.
I'm using the following code to implement the search, but it always fails (error provided below):
<br />
DirectoryEntry me;<br />
string filter = "(mailLocalAddress=" + uid + ")";<br />
string path = "ldap://10.10.240.19/o=Top";<br />
<br />
DirectoryEntry dbE = new DirectoryEntry(path);<br />
DirectorySearcher dsE = new DirectorySearcher(dbE, filter);<br />
dsE.SizeLimit = 2;<br />
SearchResultCollection src = dsE.FindAll();<br />
<br />
if (src.Count == 0) <br />
{<br />
throw new AuthenticationException("Login Incorrect");<br />
}<br />
if (src.Count > 1)<br />
{<br />
throw new AuthenticationException("Invalid LDAP Response");<br />
}<br />
me = src[0].GetDirectoryEntry(); <br />
The error I get is:
<br />
System.Runtime.InteropServices.COMException (0x80040E37): Unknown error (0x80040e37) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll() at Portal.Login.CheckPassword(String uid, String pass) in c:\inetpub\wwwroot\portal\login.aspx.cs:line 108<br />
Now, my base DN is indeed "top". What I am expecting is that the program binds anonymously to the specified LDAP server and does a sub-tree search on o=Top for my filter.
Anyone have any ideas?
-Adrian
|
|
|
|
|
After much searching, I found there is a difference between ldap:// and LDAP:// --- go figure.
|
|
|
|