|
Here is what we came up with:
1) Security is the hitch when a standard client tries to write to the application eventlog. The app searches for the eventsource in the registry and when it cannot find it, tries to create one. Due to the rights, it fails and causes our error.
2) We have a class that we wrote for use in our shop, which can be referenced in any program, and if called, can display a message box, write to the eventlog and e-mail, depending what parameters are set. We check if the event source is there. If not, we try to create the event source. If the create fails we notify the client that they need to call us and run a process we call DeployEventSource.
3) We wrote an app (DeployEventSource) which creates the eventsource and is basically setup to be installed by our team with admin or power user rights. We wanted to try to to eliminate as much maintenance as possible and I believe we accomplished this goal. Since our class above writes to a source name that we keep consistent, and our install / create source program creates a source with the same name, we only have to run the install app when someone gets a new machine or system reload. If profiles change with terminations / new hires, we do not have to keep reinstalling or hacking a registry setting. Also we can create several apps that run on this pc which uses our class to write to the eventlog, and as long as the eventsource was created once, it will work for all apps.
I hope this follow-up might help someone else who runs into the same problem. Thanks for your input!!
Lost in the vast sea of .NET
|
|
|
|
|
I am trying to automate USB "Found New Hardware" in Windows 2000 using VBS. Can anyone help me with this one? Thanks!
|
|
|
|
|
What exactly are you trying to automate? "Found New Hardware" can mean anything. Plug in a Thumb Drive and the entire "Found New Hardware" thing happens automatically without any intervention from the user, or a VBScript. What are the steps you want to automate?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Just a generic USB keyboard and mouse. Both of which are HP, but I don't want to manually go and point to the correct drivers. It is prompting me for the drivers everytime I plug them in after rebooting. Any help with this would totally rock!
|
|
|
|
|
I would forget trying to automate this. Instead, see if there is an updated driver package. Once the drivers are installed, "Found New Hardware" should make the appropriate changes automatically, without any intervention from the user.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey everyone,
I have a problem. I have a windows form that has bound textboxes. When I try to add a new record to the database, I can add the new record to the dataset, but when I try to update the dataadapter based on the dataset, I get this error:
System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
Does anyone happen to know what might be causing this I've checked the syntax of the insertcommand, but everything seems to be correct in the statement? I've checcked the insert statement based on other forms and it looks correct, but it still won't update. If someone could help me I'd appreciate it very much.
|
|
|
|
|
Hi,
an article from Joel Brandenberger, which discrips how to use simple Remoting, but there are questions ...
first the link to the article:
http://codeproject.com/csharp/RemotingWinApp.asp[^]
he uses 3 projects:
- a Server Application
- a DLL with the Interface declaration
- a Client Application
in this case it works fine but this project is designed for an local or an intranet application...
i need a way to use it at the internet.
i know it would work too, but i have to copy the DLL with the Interface declaration to all Clients.
My ServerApplication should be able to load unknown DLLs and provide them with remoting. So its not user friendly to copy new DLLs to the ClientApplication for every changing on the ServerApplication...
I thought of a possibility to load DLLs over Internet ...?
like
LoadDLL(http://server.tld/Application/AddOns/Interface.dll)
i hope you understand my problem, if not ask ^^
Copyrights © 2003 by Paebbels.net
|
|
|
|
|
i thought over this again and again and i remembered that it was possible in VB 6.0 with COM to set up a ActiveX-DLL-Server this DLL runs on the remote mashine and the cliend had full access to the dll (if i read the book in the right way... Developing COm and AXC with VB 6.0 - Dan Appleman)
but how can i build it in .NET? (VC# .NET or VB .NET)
Copyrights © 2003 by Paebbels.net
|
|
|
|
|
I have 39 buttons on a form (numbered 1-39) and I want to randomly assign text values to those buttons when it loads. So I have a sortedlist object with the values I want to assign. However, I want to use a single event (like the form load event) to assign the text string to the buttons. In this load event, I want to use a looping structure like "while" to assign the text from the sortedlist to each button. The only way I could find to do this was to generate the button identifier as a string. For example:
string = "button"&counter&".text=x.getbyindex(counter)"
x is my sortedlist instance.
Counter in this case is the counter on my loop. So as it loops the 1st time, it sets button1.text = the first instance in the sortedlist. The second loop sets button2 and so on. If there is a better way to do this, I am all ears. However, even if there is a better way, I would still like to know if VB has an execute string command. Any help is much appreciated.
scout12
|
|
|
|
|
Scout12:
1st off, there is NO WAY to execute a command like the one you are trying...
Ok, now to the solution of your problem: What you really have is an array of controls... ever heard of that? You have a full set of controls, that are all of the same class, and mostly, do the same thing. So, the best way to go is, "Name them all the same, and distinguish them by an identifying number within the 'name' definition". If you know nothing about working with arrays, you better start studying about it, because it is an actual codeing standard procedure, valuable for any programming language.
Now, concretely, you must select all the command buttons and:
At the name property, put "cmdMassReCaption" At the index property, put numbers 0...39and on the form_load, use a For...Next block structure, to peruse through all the controls that are part of the array:
For i = 0 To 39
cmdMassReCaption(i).Caption = lstTheNamingList.List(i)
Next i
So, you'll access every single one of the command buttons by using the same name for each of them, but you will also use a unique (i) indexing number.
Well, hope this is an immediate solution to your problem with buttons, but I profusely suggest you start studying about arrays, it's something you just cant't miss.
Kindly, Pablo.
-----------------------------------------------------------------------------
We live to code, this is our religion.
|
|
|
|
|
I still have some questions on this one if you don't mind.
As my example, using the visual designer, I created 2 buttons.
Q1) I changed the name property on 2 button controls to cmdMassRecaption. However, there is no index property in the property grid. There is an image index and a tab index but no index. Can you clarify this?
Q2) By placing cmdMassRecaption in the name field for both buttons, the code generator made the following declarations
Private cmdMassReCaption As System.Windows.Forms.Button
Private cmdMassReCaption As System.Windows.Forms.Button
This would not compile because the second statement produces and error stating that it is already declared. Do I have the naming syntax correct?
Q3) I searched my .net Framework documentation and can't find a reference to cmdMassRecaption anywhere. How can I find out more about this button and coding standards in the VB language?
I appreciate your help.
scout12
|
|
|
|
|
sundayschool wrote:
However, there is no index property in the property grid.
I guess Pablo assumed that you use VBA/VB 6. The suggested solution however will now work with VB .NET (for more details see Control Array Changes in Visual Basic .NET[^]).
Best regards
Dennis
|
|
|
|
|
Control arrays only exist in VB6 and below, not in VB.NET...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hey Dennis, Rage... you got it right guys, I was talking VB6 here, but I didn't know there is no control array on .Net, why is that?
and as to you sundayschool... guess you ain't going to school on sundays anyway! hehe, joking...
cmdMassReCaption is a way to name a button. I mean, the control IS A BUTTON but we give it a name we can identify it for what it does, or related to what we want to do with it. That way of naming controls and components, with three lowercase letters for a shorts of the control type, and then the name, is the GNU standard. try to keep it that way, cause everybody codes that way and when you share code, is easier for everybody else to read it and make changes to it. So:
cmdMassReCaption
^ ^--------------- The name: Mass (Re-) Caption.
|---- The type: cOmMANd.
Ok, now get VB6 and get on with studying control arrays, cause you still need it, don't think 'you don't need to know that, cause it's not used anymore'!!!
Kindly, Pablo.
|
|
|
|
|
Pablo.ar wrote:
but I didn't know there is no control array on .Net, why is that?
Because it's not proper OOP...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi,
I want to parser the data from the given query string.
mystring = "insert into testtable values(1,'ra,, j'a',100,'delhi')
in the above string, i need to take each fields seperately, How do i do this.
I want an array like
array(1) = 1
array(2) = 'ra,, j'a'
array(3) = 100
array(4) = 'delhi'
Thanks in advance
Be simple and Be sample.
|
|
|
|
|
For simple strings, without any escaping etc, you can use the string.Split function. For more complex strings (like I think you mean), the best approach is a simple character-by-character parsing of the data. I don't know of any (simple) generic parsers like this -- I suspect you'll have to write it from scratch.
my blog
|
|
|
|
|
Steven Campbell wrote:
the best approach is a simple character-by-character parsing of the data
Maybe the best approach if you'be never spotted the RegEx[^]class
|
|
|
|
|
Yes of course, you're correct -- it's probably the simplest solution for this problem, and should work 99% of the time.
99% because regex is really good at handling patterns, but really bad at handling edge cases. For example, you can easily write a regex expression to detect some characters, followed by some other characters enclosed in ( ). However, what if someone uses a ( legitimately as part of the first set of characters. This is just one of many possible edge-cases.
You then have to modify your regex to handle that. Over time, the regex becomes huge and unreadable, and probably still not 100%.
my blog
|
|
|
|
|
Hi,
I've implemented global mouse and keyboard hooks in C#, however, once I set the hook type to WH_CBT and run the application, an ugly black command prompt screen prompts out saying there was an error in CLR at runtime
Has anybody been able to implement system-wide CBT hooks in any .NET language?
If I keep getting stuck in this, can I make a c++ DLL that does all the hooking and use it in my C#/VB.NET app?
Thanks
|
|
|
|
|
I need to do a network command to purge (OS:netware)
I'm using a DOS command to delete some folder
Shell(Environ("comspec") & " /C RD /S /Q " & SubDir)
but i need to use a purge command too on a network (purge /a), to assure that those deleted won't be retrieved by any means
how can i do this?
|
|
|
|
|
Same way you ran the other command, Shell("PURGE /A"). Of course, you'll actually have to specify the correct command line for your purge.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ummm I'm not sure what is the command line for this
do i have to specify an environment like the "comspec"
would this be correct? Shell(Environ("comspec") & " /C PURGE /A ")
|
|
|
|
|
No, the commandline doesn't need to have COMMAND in it, just "PURGE /A", or whatever you'd type at the command prompt.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|