|
I add an ocx control on my form (right click on toolbox->choose item ->select special .ocx->add it on form) and work correctly. then i make setup for my project and add .ocx file to my setup project but when i install setup on destination computer this .ocx control doesn't work
why ?
|
|
|
|
|
Try registering it with regsvr32 and see if that cures it.
Regards,
Rob Philpott.
|
|
|
|
|
Is it correct : Regsvr32 /s /u Application.StartupPath+@"\dsoframer.ocx"
|
|
|
|
|
No. the /u flag uninstalls it. Just run it without any flags.
Regards,
Rob Philpott.
|
|
|
|
|
Has the target got all the dependencies installed as well?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Hello friends,
I am Navigating to a page using InternetExplorer object,
and I am using BeforeNavigate() event handler. INside BeforeNavigate I want to add one more element in POST data,here here is my code :
protected void onBeforeNavigate(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed)
{
if (PostData != null)
{
string addend = "&PageSize=200";
byte[] b = PostData as byte[];
string post = Encoding.ASCII.GetString(b);
Console.WriteLine(post.Trim() + addend);
post = post + addend;
b = Encoding.ASCII.GetBytes(post);
PostData = null;
PostData = b as object;
}
}
But this is not working Post data remains the same as it was before (without editing),Iverified it by HttpAnalyzer tool.
Please help me out.
Thanks.
|
|
|
|
|
I have a central panasonic phone (KX-TES824BX) and now i wanna to get the info of my call log via RS232c cable connected to this central phone. witch dll i should use for this purpose.
So plz help me .
Thanks!
|
|
|
|
|
1. this is not a C# question
2. you need to look at the documentation for the phone
|
|
|
|
|
I want to validate an XML file through a schema.
="1.0"="utf-8"
<Units>
<Unt Text="stuks" Service="False" Value="0" />
<Unit Text="km" Service="True" Value="1" />
</Units>
="1.0"="utf-8"
<xs:schema id="Unit" targetNamespace="http://tempuri.org/Unit.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/Unit.xsd"
xmlns:mstns="http://tempuri.org/Unit.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="UnitType">
<xs:attribute name="Text" type="xs:string" use="required" />
<xs:attribute name="Service" type="xs:boolean" use="required" />
<xs:attribute name="Value" type="xs:byte" use="required" />
</xs:complexType>
<xs:element name="Units">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Unit" type="UnitType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I use the following code :
Settings = new XmlReaderSettings();
Settings.ValidationType = ValidationType.Schema;
Settings.Schemas.Add("http://tempuri.org/Unit.xsd", Directory.GetCurrentDirectory() + strXmlSchema);
Settings.ValidationEventHandler += new ValidationEventHandler(OnSchemaValidationError);
using (XmlReader Reader = XmlReader.Create(Directory.GetCurrentDirectory() + strXmlFile, Settings))
{
if (Reader != null)
{
XmlDocument Doc = new XmlDocument();
Doc.Load(Reader);
Reader.Close();
:
}
}
My handler OnSchemaValidationError never gets called, even when
there is clearly a mistake in my XML. Why ??
|
|
|
|
|
I beleive you have to read the entire file in order for it to validate
try this
Settings = new XmlReaderSettings();
Settings.ValidationType = ValidationType.Schema;
Settings.Schemas.Add("http://tempuri.org/Unit.xsd", Directory.GetCurrentDirectory() + strXmlSchema);
Settings.ValidationEventHandler += new ValidationEventHandler(OnSchemaValidationError);
using (XmlReader Reader = XmlReader.Create(Directory.GetCurrentDirectory() + strXmlFile, Settings))
{
if (Reader != null)
{
while(Reader.Read()){}
}
}
|
|
|
|
|
Our servers have 2 physical network cards teamed together through dynamic link aggregation to create a virtual NIC.
Using WMI with Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration, I am able to see the virtual connection, virtual connections IP and MAC, I can see the first NIC's MAC address, but cannot see the second NIC's MAC address. WMI actually lists the second NIC's MAC address as the first NIC's MAC address for some reason? I can see it when I physically remote into the box and check the configuration settings for the adapter. It lists it as "Permanent Ethernet Address", but it is the MAC address.
Does anyone know how to remotely get both MAC addresses for the physical connections (Local Area Connection 1 and 2) and the IP address of the virtual connection (Dynamic Link Aggregation Team Connection 01) in C sharp?
|
|
|
|
|
If WMI won't show you the right value, I would suspect that nor will the managed methods to query that kind of thing, as they are probably a thin cover.
|
|
|
|
|
Hi Bob,
Thanks. Any idea on how to obtain that information with unmanaged code? I've noticed that the registry does not contain it either, although I found a key that contains part of the information
HKLM\System\CurrentControlSet\Enum\PCI\VEN_8086&DEV_105E&SUBSYS_135E8086&REV_06\FF[last six of MAC here]00
Any idea how intel is using this to create the entire 12 character MAC address?
|
|
|
|
|
Sorry but no, I've not done anything like this.
|
|
|
|
|
In case anyone else runs into this ... Intel creates its own WMI entries.
They are available at root\IntelNCS2, if you do an enumeration of all values you can find just about all you need with the following select * where :
IANet_PhysicalEthernetAdapter
IANet_EthernetAdapter
IANet_LogicalEthernetAdapter
IANet_Setting
IANet_TeamedMemberAdapter
IANet_TeamOfAdapters
IANet_TeamSettingEnum
By doing this, you can get MAC's, names, display names, etc.
I found this by enumerating through all of the wmi classes on this box by tweaking the code below, and then searching for the IntelNCS2 classes once I identified the Intel namespace.
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
namespace MyConsoleApplication
{
class Program
{
static private void GetWmiNameSpaces(string root)
{
try
{
ManagementClass nsClass = new ManagementClass( new ManagementScope(root), new ManagementPath("__namespace"), null);
foreach (ManagementObject ns in nsClass.GetInstances())
{
string namespaceName = root + "\\" + ns["Name"].ToString();
Console.WriteLine(namespaceName);
GetWmiNameSpaces(namespaceName);
}
}
catch (ManagementException e)
{
Console.WriteLine(e.Message);
}
}
static void Main(string[] args)
{
GetWmiNameSpaces("root");
Console.ReadKey();
}
}
}
|
|
|
|
|
hi
how we can add two number with n digit?
|
|
|
|
|
Please tell me you are not asking how to add two numbers. Please clarify
No comment
modified on Wednesday, August 24, 2011 10:22 AM
|
|
|
|
|
Break the number up into machine size chunks, start with the least-significant chunks, add those up. If they overflow, carry the overflow to the next two chunks in line: add those up, and add 1 for the overflow from the previous if applicable.
Repeat this process until you have reached n bits.
|
|
|
|
|
At some point in this process, it may be necessary to remove shoes in order to continue the algorithm.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Giving you the benefit of the doubt that this isn't an idiot question and you're asking about numbers that would overflow ulong: use BigInteger. It has arbitrary precision, so you can use it to do arithmetic on numbers of any size.
|
|
|
|
|
BobJanova wrote: It has arbitrary precision
I prefer "almost unlimited" precision, makes the results more trustworthy.
|
|
|
|
|
Hi
I have following loop. With one of the workflow, rangeDataMappingsToClear gets 100,000 records and rangeKeyMappings gets 10,000 records. This is taking long time hence application hangs.
How to simplify this loop?
List<string> rangeDataMappingsToClear= new List<string>();
Dictionary<string, object> rangeDataMappings = new Dictionary<string, object>();
Dictionary<string, List<string>> rangeKeyMappings = new Dictionary<string, List<string>>();
foreach (string key in rangeDataMappingsToClear)
{
rangeDataMappings.Remove(key);
foreach (List<string> formulaKeys in rangeKeyMappings.Values)
{
while (formulaKeys.Remove(key)) { }
}
}
rangeDataMappingsToClear.Clear();
|
|
|
|
|
you seem to need two nested loops, nothing can remedy that, unless your problem would allow for a different data structure altogether.
However, if you have 100K rangeDataMappingsToClear elements, and only 10K rangeKeyMappings elements, that would indicate rangeDataMappingsToClear holds lots of duplicates; the first step would be to simplify rangeDataMappingsToClear, eliminating the duplicates. Either make sure you don't cause duplicates (that is the cheapest solution), or create a new collection holding all the distinct elements just once; a Dictionary or HashSet could simplify this step.
|
|
|
|
|
As Luc has alluded to, if one of the issues is that the rangeDataMappingsToClear list does contain a lot of duplicates, a quick and dirty fix could be to use the Distinct method
foreach (string key in rangeDataMappingsToClear.Distinct())
"You get that on the big jobs."
|
|
|
|
|
I'm not sure, but you could perhaps create a new list from rangeKeyMappings by applying a lambda expression on it that does not take the values containing a key. Wild guess though.
V.
|
|
|
|