Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

KenBonny

@KenBonny
About
Posts
121
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Multiple Configuration Files In One Application
    K KenBonny

    In my application, I need to address multiple configuration files. This is because different people will supply a configuration file and the application should process the information inside. The layout of each configuration file looks like this:

    Is there an easy way to keep track of several .config files and can I read those using the configuration manager? Or should I write a class to read several .xml files with said format?

    Visual Basic xml question workspace

  • Windows Service
    K KenBonny

    Yes. (I had thought of decompiling the code and doing it myself, but all dll's that are shipped to clients, must be obfuscated.)

    Visual Basic csharp visual-studio question

  • Windows Service
    K KenBonny

    Hmmm, I can use the sc command in code... I think. Thanks! EDIT: It worked. You can add and delete a windows service with:

    Const ServiceName = "Name"
    strPathService = My.Settings("path")

    Shell(String.Format("sc create {0} binpath= ""{1}"" start= auto displayname= {0}", ServiceName, strPathService), AppWinStyle.NormalFocus, True)

    modified on Monday, July 11, 2011 3:13 AM

    Visual Basic csharp visual-studio question

  • Windows Service
    K KenBonny

    I have to make an installer for a Windows service with a Visual Studio installation project. But the guy who made the service (not me), just gave me the compiled .dll and .exe that is required. Now, everywhere I see, I have to compile the webservice with an installer class specifying the name. Is there another way to install windows services without this installer class? Like running the InstallUtil.exe from code with the location of the .exe as a parameter? (Tried that, doesn't work at the moment. No idea why.) Any other ideas?

    Visual Basic csharp visual-studio question

  • WebService monOccurs and maxOccurs Without Nillable [modified]
    K KenBonny

    My webservice takes in a couple of parameters, some are integers, some are strings and some are self defined structs. Now the integers' minOccurs and maxOccurs are set appropriately to 1. But with the strings, in both webmethods and structures, the minOccurs are set to 0. Is there a way to set them to 1 without setting ? I don't want them to be optional and I don't want them to be null-able. EDIT - In one webmethod, one of the parameters is an array of a self defined structure. Is it possible to set the minOccurs number? I know it can't be done with because that gives an error in my webservice. If I look at the WSDL description of my structures, I see that the minOccurs of the string fields is set to 0. Is there a way to change that? I can provide code samples if necessary.

    modified on Thursday, June 30, 2011 6:16 AM

    Visual Basic wcf data-structures help question

  • Installer [modified]
    K KenBonny

    I didn't know I had to pass the variables I want to use to my installer class. Read the below article to know what I did wrong (and how you can avoid it too). Visual Studio Setup - projects and custom actions, by Phil Wilson

    Visual Basic help xml

  • Installer [modified]
    K KenBonny

    I'm making an installer of my webservices and I'm stuck at the last bit. I'm trying to change some values in a custom xml file that I'm installing. I don't save my settings in an web.config file, but in either public, protected or private.config.xml file. I want to change the $logPath$ variable in the document with the installation path. I've figured out that with custom code I can do:

        MyBase.Install(stateSaver)
    
        Dim xmlDocument As New System.Xml.XmlDocument
        Dim strPath As String = System.IO.Path.Combine(Context.Parameters.Item("TARGETDIR"), "public.config.xml")
    
        If System.IO.File.Exists(strPath) Then
            xmlDocument.Load(strPath)
    
            xmlDocument.ToString().Replace("$logPath$", Context.Parameters.Item("TARGETDIR"))
    
            xmlDocument.Save(strPath)
        End If
    

    Rinse and repeat for the other files. But I get an error: "1001 - parameter path1 cannot be null". That's the first parameter of the System.IO.Path.Combine() function. But it's not null, there should be a path set.

    modified on Monday, June 27, 2011 10:35 AM

    Visual Basic help xml

  • WebService Deployment [modified]
    K KenBonny

    I just wrote a couple of webservices, with references to vb code behind files. Now that I build my webservices, I still need to deliver the code behind files as ordinary vb files, they didn't compile into dll's. Is there a way I can compile the vb files to dll's and ship those to my client? Or do I need to put the vb files (with proprietary code) on my clients server? EDIT - And how do I automatically change the path of the codebehind file automatically to the .dll when I build? Can somebody help me? I have no idea how to tackle this problem.

    modified on Friday, June 17, 2011 4:47 AM

    Visual Basic sysadmin help question tutorial

  • Reflection: Get Subclass Type [modified]
    K KenBonny

    Thanks mate, I needed the Object.GetType(), used Me.GetType() works too. Thanks for the help, both of you!

    Visual Basic question oop

  • Reflection: Get Subclass Type [modified]
    K KenBonny

    The Reflection will give you the "Base" name. The StackTrace would give you the name of the calling Mehtod. I needed the name of the type of the subclass. I know Sub is not a valid name, but I was making a quick example program, my actual program is a lot more complex, but I just needed the type of the subclass.

    Visual Basic question oop

  • Reflection: Get Subclass Type [modified]
    K KenBonny

    I have a situation with inheritance. In my base class I have a function GetName() which I want to supply the name of the class that calls the function. But how do I give the name of my current subclass and not the base class? This is my code so far.

    Class Base
    Public Function GetName() As String
    ' Bad code
    'Return System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name.ToLower()

    ' Good code
    Dim type as Type = Me.GetType()
    Return type.Name
    

    End Function
    End Class

    Class Sub
    Inherits Base

    ' Some unrelated code
    End Class

    ' In program somewhere
    Dim s as Sub
    Console.PrintLine(s.GetName()) ' should print out Sub, but it prints Base

    EDIT: I found the solution. about 30 minutes after this post, I found it. :( Adjusted the code.

    modified on Wednesday, June 8, 2011 9:43 AM

    Visual Basic question oop

  • Loop over chars in a string
    K KenBonny

    I have a string in an XML file and I want to display each letter (or number) in a different box (div). So I made the div tag and I want to display one letter (or number) in it. Currently I have this code:

    ...

    name person

    ...
    1

    Any advice on what I can improve? Because this isn't working. Thanks in advance!

    XML / XSL xml question code-review

  • University
    K KenBonny

    Thanks for all the insights guys. For you who want to know, I live in Belgium. The difference between college and university is that college is hands on, lets get programming and lets plug in some cables and see what it does. While university is math and lets see how compression works in (theoretical) depth. Not sure what I'm going to do yet, find a job or go to uni. Thanks for the insights though.

    The Lounge question

  • University
    K KenBonny

    I wanted to ask: I have a college degree in informatics, and I like programming. I wanted to ask if getting a university degree is worth the 4 year struggle?

    The Lounge question

  • I hate incompetent fools...
    K KenBonny

    ChrisElston wrote:

    It has often seemed to me that the one skill you need most to provide support is the one that most of those in the job lack.

    Would that be: - people skills - deductive skills - brains - actual computer knowledge - all of the above

    The Soapbox testing beta-testing question

  • Network Problem
    K KenBonny

    Mark Wallace wrote:

    the network problem you have encountered is completely unsolvable

    Are you referring to the workgroup and domain problem or the crappy chair problem? I'm really kinda confused (and amused) here.

    The Lounge sysadmin help tutorial question

  • Network Problem
    K KenBonny

    Mark Wallace wrote:

    You should get out more!

    Every Friday and Saturday. And sometimes during the week when my friends don't have to work. I'm one of the few in my group of friends who's still studying. (Master in informatics if you're wondering.) The problem is that dad keeps nagging me to fix it, so he can watch my movies on his laptop. That way, he can watch them on the comfortable sofa and not the cheap and crappy chair he got for my desk where my laptop is.

    The Lounge sysadmin help tutorial question

  • Network Problem
    K KenBonny

    I've got a little problem at home with my network. I'm still living with my parents and my pc (Win 7, in a workgroup) is connected to the home LAN. My dad's work laptop (Vista, registered in a domain) is also connected with the home LAN. But for some reason his Vista laptop can't even detect my Win 7 pc in the network. Any idea's on how to get these two to talk to eachother? We've tried a lot of things, but none have helped. I won't go into a list, because if I did one wrong, I want to try it again and maybe we'll figure out what I did wrong or why it won't work.

    The Lounge sysadmin help tutorial question

  • Great headline, funny story...
    K KenBonny

    What's wrong with a little naked jumping? If he thinks it's fun, let him jump and jack... off. People get so upset about little things these days.

    The Lounge com question career

  • Hacked Hotmail
    K KenBonny

    I'm keeping my pw's now in a text file in an AES-Twofish encrypted TrueCrypt file.

    The Lounge question tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups