Answer Questions
laboremus Favorites/Registry Help Needed!
I am making a web browser in C#. I need help doing the favorites. I got as far as populating the favorites menu with a list of values from the "LocalMachine\Software\WebBrowser" key.Now how can I make the browser navigate to the clicked menu Heres what I got for the App to load the list of values: RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\WebBrowser", true); private static void Form1_Load(object sender, EventArgs e){ RegistryKey RK = Registry.LocalMachine.OpenSubKey("Software\\WebBrowser"); if(RK != null){ string[] valNames = key.GetValueNames(); foreach (string x in valNames){ favoritesToolStripMenuItem.DropDownItems.Add(key.GetValue(x).ToStr ...Show All
samymelbourne Inherit Generic Forms
How can generic forms / controls be inherited I made some generic forms and controls i want to use in my application as base forms/controls. When i inherit these forms/controls i cannot view the designer anymore. Is it possible to inherit these generics and how Nightmare_BE wrote: How do u write the code, when u look at the code of a new form both the form and the designer class are partial classes. Do u put the public class MyCustomIntForm : MyGenericForm < int > { } on top of the form class, at the designer or into a external code file It can't be the first class in the new form's .cs file, because the designer will crack it anyway if you do that. I just put that ...Show All
Curtis Gray Converting a string to int
I'am building a console program and need to convert a string that the user types to an int. If I use convert.ToInt32 a get the ascii code for the number but not the number it self. can anyone help me find a easy way to do this, if there is one :) hi Damon the input for my program can be something like this 1-9 7-9 So my problem is that I need to find just the charcters that are actual numbers and use the in my program the code I use to do this looks like this: for ( int i = 0; i < str1.Length; i++) { if ( Char .IsDigit(str1,i)) { int a = Convert .ToInt32(str1 ); Console .WriteLine(a); } } put this code returns 57 if the number 9 is in the string. I use Console.ReadLine() to ...Show All
TjMulder Form files accidentally split up
Hi all, I've had this come up a few times, and it seems like it should have an easy fix, but I'm absolutely baffled. So at the risk of sounding stupid, I could use some help! While working in Solution Explorer, I somehow accidentally dragged the .resx and .Designer.cs files of a form out of place, so they're not no longer children of the parent form... they're siblings in the project folder. My code compiles fine, but when I try viewing the form in Designer mode, the form shows up blank. Plus, the misplaced files add clutter to my project directory. I can't for the life of me figure out how to move these files back into place as children of the form.cs file. Does that make sense Anyone know a solution Thanks! Mark Jacobsen ...Show All
Alex Farber DllImport call using a struct as param throwing exception
Hello, I'm trying to call a C DLL, and having some issues building a struct that will pass through successfully. Here's an abbreviated version of the definitions in the C .h file: typedef struct { /* inputs */ char hist[ 4 ]; char site[ 5 ]; char behav; char grade; char age[3]; char size[3]; char ext[3]; /* display outputs */ char t[12]; char tdescr[4]; char n[12]; char ndescr[4]; char m[12]; char mdescr[4]; /* error messages */ unsigned long error; char messages[ 2000 ]; } datacard; #define CSTAGE_API __declspec(dllimport) CSTAGE_API int CStage_calculate( datacard *dc ); On the C# side, this is what I have so far: &nb ...Show All
pat1975 Error Message
When attempting to reply to or send an Outlook message when accessing my employers Web VPN service on my home computer I receive the following message: "one or more errors occurred while the message was being sent. Error: (0x8000ffff): catastrophic failure." I have tried many things, including switching off firewalls but to no avail. I can access it through other computers so there is clearly some barrier somewhere in my own PC. Any advice would be appreciated: to date other "experts" are mystified. Thanks in anticipation. Is this a development related question at all to me it does not seem like it, but if it is then please post some code and exactly where ...Show All
Shareef Dana Types and Variables
Is it possible to make a Type into a Variable What do you mean that was just what i needed thanks. i Know this is bieng abit cheeky but do you have any idead on how to do the following. How to get a webpage to navigate to the selected Url public string TheURL { get { return yourCombox.Text; } set { this.theURL = value; } } well if you are using a webbrowser control then to navigate to a webpage: this.theWebBrowserControl.Navigate(" http://someurl.com "); in your case it may well be: this.theWebBrowserControl.Navigate(this.TheURL); Can you explain your question Regards ...Show All
Manivannan.D.Sekaran VS 2003, develop Web Services "offline"
With Visual Studio 2003 (any language, but we happen to use C#), it seems you can't develop Web applications in the IDE without connecting up to a web server. In other words, I can't just copy the files to an offline folder (meaning, some folder that isn't part of a web server virtual directory), double click on the .csproj file, and be off and running. No... I must tell it where my web server is. What if I don't have access to one at the moment. Sure, I'll need one to test and debug, but I need one to start writing the code This doesn't just go for web services, but seemingly any web based project. Thanks... I also have access to VS 2005 and I've experienced everything you have said. Was just hopi ...Show All
mxmissile Can one access and read messages from a remote system dead letter queue (MSMQ) ?
I want to read messages from a system dead letter queue remotely. is this possible I tried using "FormatName:DIRECT=OS:<servername>\XactDeadLetter$" as the queue path but the CanRead property of the message queue returns false. Please help. Thanks yvidarsh ...Show All
Corey Bornmann Working With DirectoryInfo to Move Files
Im trying to use MoveTo and a generic way to rename the files. but i need a way of iterating through the list, i had somthing the other night and it got lost but it was somthing like this DirectoryInfo di = new DirectoryInfo("FILE PATH"); foreach (FileInfo fi in di.FileInfo) { do stuff } but i know that doesnt work, does anyone have a way of getting the list of files, then iterating though that list You need something like this: string[] arrFilesInDirectory = Directory.GetFiles(@"D:\\RizwanSharp"); for (int i = 0; i < arrFilesInDirectory.Length; i++) { File.Move(arrFilesInDirectory, /*Put your new name here*/ ); } There is n ...Show All
M. Casco REAL C# world : open source ?
I am a java guy, now I want to switch to C#. I want to compare both language. in the Java/J2EE web framework ----- Struts / Spring persistence object-relational ------ hibernate IDE ----- Eclipse third-party library ------ apache web server ----- tomcat application server ---- JBoss hot forum ---- www.javaranch.com what about REAL C# world Do we have lots of open source C# projects Thanks. If you go to sourceforge, there's some open source C# projects. Example this http://www.sharpdevelop.net/OpenSource/SD/Default.aspx With sharp develop you can freely develop C#, VB# and some other programs. Hope this helps a little bit! :) Regards, Timo ...Show All
Duncan-Countrywide casting
hey all, Just a quick question about casting and how it works. if is do String s = (string)someobject, what happens in the background i.e. some method is invoked intternally to convert the object to a string or what How does this work I tried to find the answer but no luck. Please help . Thanks sunny Hi, Actually, the C# compiler will not let "someobject" cast into string, unless someobject is an instance of compatible type (string or types derived from string). Here is more knowledge about casting: http://msdn2.microsoft.com/en-us/library/ms173105.aspx Thank you Hi it's not some hidden method... i'll try to give you an explanation that's not really technical but which can give you an idea ...Show All
Jim Altrichter Properties in C#
Hi All, I really have a doubt regarding use of property in C#. My question is: Can we have private properties inside a class If yes, then please let me know what is the use of private propertise in a class. Thanks and Regards, ChatanyA Agrawal By using a Property you dont need to create two different methods to set a value and another to retrieve a value. In a single property, with the same name you can get and set. Although this can also be achieved through an overloaded method. You have a very good question as to Why use private properties. Consider this: private int Kilogms { set { grams= 1000*value; kilogms = value; } get { return kilogms; } } ...Show All
Islam Imam Raising an event in C# that impliments a VB interface?
Hi. I have an public interface class in VB that I'm trying to use in C# (I'm converting my ways to C# - like it!!). I'm getting the following error when trying to code for the event handler: C:\<path>\newDevice.cs(7,18): error CS0536: 'deviceInCsImplimentsEquipIL.newDevice' does not implement interface member 'EquipmentIL.EquipIC.Methods.ConnectionEstablished'. 'deviceInCsImplimentsEquipIL.newDevice.ConnectionEstablished' is either static, not public, or has the wrong return type. Here are two events from the VB portion of the interface: Event ConnectionEstablished( ByVal id As Long , ByVal address As String , ByVal port As Integer ) Event NewData( ByVal id As Long , ByVal message As String , B ...Show All
Don Cameron a dll question.
It may not be directly related to the forum, then please advise. It is a very common problem for me. Trying to incorporate a third party demo app into my project I download a dll and try to register it. I get the same error message in many a case: The procedure entry point Wow64EnableWow64FsRedirection could not be located in the dynamic link library KERNEL32.DLL It is natural. Mine is 32 bit machine. I do not need any 64-bit functions. Apparently those functions are included for generality. I need the darn dll. What can I do to make it register. Thanks in advance. Is this what you are talking about http://www.nplot.com/ As far as I see it is a C# dll and the source is included. Why do you want to register it How ...Show All
