I am making a program where there is a number of strings are needs and they need to be pre-defined. I rather not store it all in a XML file as I don't want anyone going in and altering them.
Has anyone ever created a class of public constants just to make cleaner code or is it considered bad practice?
I want to know how to use DEBUG const in DLL.-> I have a web application in vb.net-> I have a DLL whith some function.Now i have reference this DLL into my web application. And now i want to check in dll whether my application is in DEBUG mode or in Realease mode.Second thing i want to check some validation in constructor based on that constructor will throw exception and i want to show it on page without handling. I have used try catch in constructor and not used in page, so it will give me error in dialog box not in page.
VB2008: I would like to set a #Const value in a module and use it throughout my project. Is this possible? It appears that the #Const scope is limited to the function it's in.
For historical reasons, we need to expose string constants in .NET through COM interface.We managed to expose ENUM but we can't find a way to expose string const.We try the following code :
I have a problem that is frustrating me to no end, I have a overrideable function in a parent class, and the override function in the child class, like below:
[Code]...
When i debug, the value is produced, but it doesn't carry over to the parent class of ski.RetailPrice()what seems to be the problem here?
I've made some function that generates an email template. Code it generates is pure HTML with CSS. Problem is compiler does this odd error and highlights each time '#' sign appears which is needed to define colors in CSS. I did try to change '#' to '/pound/' and then string.Replace() on RETURN but no luck. I'm more into C# so there i can escape special characters by using '' before them but something f$#$ed up there... Once i remove '#' all back to normal and compiles well.
Is there a way to define a conditional define, i.e. #const, in a asp/vb.net app that it accessible across multiple source files? I want to use, for example, #const useOracle=TRUE but to be able to change it's value in only one place.
bare with me during this silly example. :-) Let's say I have a class like this:
Public Class Animal Public iLegs as int32 ' Number of legs Public bWings as Boolean ' Wings? Yes/No End Class
And another class that inherits the "Animal" class and adds one more property:
Public Class ScaryAnimal Inherits Animal Public iScariness as int32 ' 0-100, how scary is it? End Class
Now, if I have an instance of "Animal" with some values in it, and I decide I want to cast it to a ScaryAnimal for some reason, how do I do that without having to create a new instance of "ScaryAnimal" and copy each property value?Basically I'm looking for a way to do this, without having to write the lines marked with '*** below:
I'm looking for some code (C# or VB.NET preferred) to iterate through all folders in an Outlook mailbox and return the names of those folders. I'm not looking to pop up the Outlook folder dialog, but rather to return the folder names in a given mailbox from outside Outlook.
I'm writing a little Database administration program.It works fine if you give the db, but not when you don't know which db is installed.How can I enumerate all running databases?
I want to enumerate all the directories in C: and also at the end of it I want the size. Now, I can enumerate the directories but I have no idea how to get the size.
I have the code here but everytime I try and add My.Computer.FileSystem.GetFileinfo it bombs out saying that I have not expressed it. I suppose I need to add a variable for my.computer.filesystem.getfileinfo but how do I add two variables in one for each statement.I guess I could declare it outside the "for each" statement.[code]...
I think my problem is easy to solve. I developed an interface called "Animal". My programmers created classes for "Dog", "Cat", and "Horse" Later I want to let the user create an animal in a Windows form. How can I get my annimals to appear in the combo for selecting one of them? Each animal has it's own DLL. If tomorrow a new animal is developed, the combo should present the new value.
I want to create a form almost exactly like the database properties page that appears in SQL Server Management Studio when the properties of a SQL CE database is selected. Basically, the form has page options that show general properties in a propertygrid, a shrink and repair page option, and an option to set the password. Does Microsoft have some code posted on how they show the properties page of a sql ce database?
Because I need to get all the characters of the alphabet OF AN ARBITRARY (variable) LANGUAGE, and that in the correct ordering sequence.
How can I do that without knowing the alphabet of every possible culture/language? System.Gobalization.Cultureinfo for example has information on date format, and a sorting method, and codepage info. But not info on the alphabet itselfs. Forthermore 'A' to 'Z' ordering iterating won't do, because German for example has characters such as ÄÖÜ, which are after 'Z' in the codepage numbering, but follow after aou when sorting.
Can I somehow use the codepages to get all the characters, and sort them somehow ? By 'all the characters' I mean all letters, including numbers, but not punctuation marks. And possibly only upper XOR lowercase.
Does anyone know how to enumerate through the set of file attibutes that are part of Windows? How are Unions handled which have a sum of 28 in file attributes?
I need to know how many times an Item is repeated in a listbox? I use Listbox1. items. contains(Any string) to determine if this item is existed or not , But I need to know how many times??
Dim oControl as Control For Each oControl In Me.Controls debug.print oControl.Name Next
the thing its that i doesnt enumerate the child objects for example..
if the form has a tabcontrol, it will spit only Tabcontrol1 but i want to enumerate everything contained in all the form even of theyr childs of other objects.
In a case where you would like to reset an array of boolean values what is faster, rediming the array or enumerating and resetting the values? I have run some tests and they seem to suggest that a redim is a lot faster but I am not convinced that it isnt a result of how I'm running the tests.
My tests seem to suggest that redim is nearly twice as fast.So could anyone care to comment on which is faster and why? Also would you expect the same result across different languages?
i have this class that i'm calling from a telerik report. when debugging asp.net application the report shows the right results but when i deploy to IIS it just return the first row and not the SUM of the salary variable.
Imports System Imports System.Collections Imports System.ComponentModel Imports System.Data
I am having a issue with my app, I know it is going to be something easy that I am doing wrong, but I just can find what it is. I am to take a quantity of an item and then * by the price of the item to get the total. This works fine when I get the first values, but if I want to add to the total that I have with new values, well, thats were I am having issues.
Here is my button
Private Sub Btn_Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Add.Click 'Declaring the instants of my class Dim Sale As New BookSale
[CODE].............
And here is my class
Public Class BookSale 'Setting the vars so the can be used as calculation Private dec_quantity As Decimal Private dec_price As Decimal