Ingenious's Q&A profile
Visual C# Perl to C#
hi, I have a little piece of code in perl and i need to convert it into C# application. I tried searching for a converter online but no luck. I was wondering if someone could help me do this. I'm pasting my code below: ************************************************** sub GetFiles { my ( $ftp, $Path, $UNC ) = @_ ; my $RetVal = 0 ; if ( $ftp->cwd( $Path ) ) { foreach my $Dir ( $ftp->dir( ) ) { #print "Dir: ", $Dir, "\n" ; my @Parts = split( /\s+/, $Dir ) ; my $Type = $Parts[ 2 ] ; my $UDir = $Parts[ 3 ] ; if ( "<dir>" eq lc( $Type ) ) { my $NewPath = $Path . '/' . $UDir ; my $NewUNC = $UNC . $UDir . '/' ; #print "New path: ", $NewPath, "\n" ; if ...Show All
Visual Basic "Save Changes" box
Hi, I have a single form and I want to make it so that when the user closes it it asks "Save Changes " Yes|No|Cancel. I've done: Private Sub Main_FormClosing( ByVal sender As Object , ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me .FormClosing Dim r = MsgBox( "Save Changes " , MsgBoxStyle.YesNoCancel) If r = 6 Then save() ElseIf r = 2 Then End If End Sub But when I handle the Cancel button (upon which I want to leave the window open) I don't know how to stop the window from closing. Hope this makes sense - any ideas to stop the Window from closing, just cancel the closing event by d ...Show All
Visual Studio Express Editions Newbie How to question
Hello To All: This is my first post. In regards to vb5-express how do you write a code for a button that will display a change for a dollar In other words I have a textbox that ask the user to enter cents from one dollar. However I do not know how to write the correct code that will give the user change in half dollars, quarters and so on, by displaying the change in a label after the button or calculating button is pressed. Any help welcome Here's some code which is probably going to show you the general idea. Public Class Form1 Const Quarter As Integer = 25 Const Dime As Integer = 10 Const nickel As Integer = 5 Const Penny As Integer = 1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As ...Show All
Visual Basic SelectNextControl method
Hi, I'm creating a enhance textbox control that can accept only numerical value. To do so, I've created a new user control that inherit the textbox properties and added my own code. When the return key is hit, I want to focus to be pass to the next control. I added the following code in my control class but the SelectNextControl method does not appear to work. I used the step by step debugging method and everything work perfectly except that the next control is not selected. I think that it has something to do with the IsInputKey method but I don't really know what to do about it. The escape key work fine, but the other keys doesn't work. Note : There is a least 2 controls on the test form with the tabstop property set to true ...Show All
SQL Server Process AS2000 Cubes in SSIS
Hi, I would like to process an AS 2000 cube in SSIS. I'm using the 'Analysis Services Processing Task', but I just get the error 'A connection cannot be made. Ensure the server is running'. It would be an unfortunate limitation if you can only process 2005 cubes in SISS. Does anyone know if its possible to process 2000 cubes in SSIS Many thanks Jeremy I am trying to do the same thing! - we have a 3rd part dw app that uses sql 2000 olap, and will not support an upgrade to 2005 olap. Did you find anything new ...Show All
Visual C# how to return null from a constructor
say, i a m trying to do something like: class something something(streamreader){ if (wrong format or end of file) caller receives null as result else build object from what has been read in file } i tried 'return null', but it says it can not do that since a constructor is 'void', so i can not place a return sentence. i'm not sure something like this.dispose would retunr a null, since the 'dispose' may be asynchronous (or something) i have the next alternative class something blah blah somehting(string) (build object from string, check if string==null or wrong format before calling) static bool checkformat(string) check to see if string is adecuate to build somet ...Show All
.NET Development Error trying when remoting to a external server
Hi everyone; I’m creating a remote object using remoting, when I test the application into my LAN it executes correctly, but when I try to connect it to an external server, I get next error: System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn on customErrors in the server's .config file. I’m creating the channel connection programatically without a config file and always get the same error. I was searching a solution without sucess. I hope somebody can assistance me. Thanks; Its a firewall issue ( I think) Make sure you have the window's firewall turned off, just to make sure it works. Then you can configure it. -SKumar ...Show All
Windows Forms include vfpoledb.dll into .net build (VB.NET 2005 windows forms)
Hi, I need to distribute vfpoledb.dll along with my application, the dll needs to be placed into C:\Program Files\Common Files\System\Ole DB (create if doesn't exists) and register it using regsvr32 How can I do that Thanks, Igor I think you're supposed to use this: http://www.microsoft.com/downloads/details.aspx FamilyId=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en and run that exe. Are you using a setup project I think you could run this as a custom action. ...Show All
.NET Development Remote MSI install using c# and WMI
Hi, I having a problem whilst trying to install an application on remote machines using WMI. The code im using seems right, but it just isn't working. Can anybody,please, help point me in the right direction Or maybe post a link/script i can have a look at Just to note the strings.. _DOMAIN _USERNAME _PASSWORD _MSIPATH _ARGS _MACHINE are all set correctly before they are passed to the method... Here is the code I'm working on...The thing is it doesn't throw any Exceptions at all, but it dosen't work either. So i am at a bit of a loss as how to fix it... Any help at all would be greatly appreciated. CODE: ----- public void installMsi(string _DOMAIN, string _USERNAME, etc, etc) { ManagementScope ms = null; // Connect ...Show All
Smart Device Development Audio not working
I recently discovered that the emulator dose in fact support audio, something I didn't grasp since I've never heard anything from the emulator. Did some checking, i.e. turn all the volumes to max including the speakers and sure enough there was a faint yet audible sound. All other sounds on my systems works normally, Media player, games, startup sounds. Is there anything special I need to do to set the emualtor's volume correctly Hello, I have the moto Q and the volume is not adjusting at all. I don't have speaker or headphone volume at all. I have tried to extend the volume on the player and all of the profiles have been adjust to the highest levels, can y ...Show All
Visual Studio Visual Basic 2005 Express Edition INSTALATION HELP Needed
When I install, it prompt "Fail to download - Microsoft Visual Basic 2005 Express Edition - ENU" . My machine used to have VB6 which was uninstalled using auto-uninstall tools in support page (Visual Studio 2005 express). And I've try to create a blank folder - "C:\Program Files\Microsoft Visual Studio 8 - Microsoft Visual Basic 2005 Express Edition - ENU". But it still not work. Help !! How are you doing the install, are you using the web install or the full iso download. My suggestion is to download the ISO and burn a CD of the image, then install from the cd. The bonus with this is that you do not have to register the product. ...Show All
Visual Studio Team System Sharing code projects in Team Foundation Server
We currently use VSS for source control, we want to move on to TFS Source control as we want all the extra functionality of work item tracking, multiple check outs and the version control etc.. the problem I am having at the moment is how best to get round the issue of sharing code projects (libraries, c# projs whatever you want to call them!) between applications. At the moment we have several applications that all use a project called GENERAL.PROJ, they all use the latest up-to-date version of GENERAL (which lives in one place both in source control and locally) and whenever you are working on an app, it's simply a case of doing a "get latest" and you have the latest, when you make change to GENERAL, you check them in and in ...Show All
Visual Studio Express Editions very simple calculator
Hi everyone, This will sound completely noobish ^_^" but i can't get it to work. The thing im tring to do is extremely simple but i can't find any info on it what so ever. Im still a C# beginner and i guess i got heaps to learn :D There are two textboxes and a button on my form on click it should collect the values from the two textboxes and add them together that's it. However, i keep getting a 'can't convert string into int' error. (when i try and pass the value as a string instead of a int it works without problems i.e. when i try to display my first and last name using the textboxes) Thank you for your responses :) or just change MessageBox .Show(intResult); to MessageBox .Show("Result: " + intResult ...Show All
SQL Server SSIS - Connection String Issue
Hi I have been trying to resolve a connection string issue all day, and havent figured out whats the problem. I keep getting the Acquire Connection error everytime I run my package. Can you someone review the format of my connection string, and confirm that it is indeed the correct format: I have two conn strings specified in my config file, one is to connect to a remote database and one is for local. I have validated the connectivity from my server to these databases via Management Studio, and it seems to connect fine. But when I run my package it keeps failing. SQL Server Authentication(Remote Database Server): Data Source=server_name;Username=useraccount;Password=xxxxx;Initial Catalog=dbname;Provider=SQLNCLI.1; Window ...Show All
Smart Device Development Locking an application
Hi all, How would I go about locking an application so that one would need to re-enter a username and password to gain entry again. I know thats very vague so here goes; Background: Im new to C# and developing a C# mobile app which displays confidential info to the user. Ideally, if the user has not tapped the screen for x minutes, the application should lock itself and not permit the user to see what it was displaying. This functionality should also be available as an icon incase the user voluntarily wants to lock the application. This are my thoughts on accomplishing this: Have a thread that monitors for taps and if the time between last tap exceeds a certain ...Show All
