
bri189a
Avatar/Signature-
Posts
1014 -
Joined
-
Last visited
Everything posted by bri189a
-
Your code for opening the form should look something like this: Dim myForm2 as new Form2() myForm2.Show() myForm2.Label2.Text = Me.DateTimePicker1.Date.ToString() Or something close to that, I work in C#, so the syntax may be incorrect. You could also have something in the Form2_Load event (if it is opened by Form1) like the following: Me.Label2.Text = Owner.DateTimePicker1.Date.ToString() I think it's Owner... going off of memery right now... the problem with this would be is that if something opens Form2 other than Form1 you will get an error because that Form doesn't have a DateTimePicker1, another option would be to keep the value of the DateTimePicker1 in a global variable that would then be accessed the same way in the Form2_Load event. Hope this helps.
-
Get files in folder and all sub folders
bri189a replied to dannyres's topic in Directory / File IO / Registry
yeah, see looking back at this this could've been in one function, also my try-catch should've been in the loop itself because as it stands if it encounters an error the function is exited and there still maybe umpteen sub-folder past the one it is checking to check. Like I said I whipped it out without really thinking about it. -
Get files in folder and all sub folders
bri189a replied to dannyres's topic in Directory / File IO / Registry
Okay man, this goes through all the folders and files on your E: drive if you have one, change if necessary; this is in C#, but you should be able to translate into VB without a problem. Pay particular attention to the Try/Catch statements! I have a P2 1.0Ghz and my E: drive is only about 600Mbs and it executed pretty quick; however on a typical C: drive it will take longer, especially if your adding this stuff to tables. If you can make since of this, putting the code in for putting it into a database shouldn't be a problem for you. There are probably more efficient codes for doing this, but I scraped it out in 5 minutes so you could move on with your project and didn't really think it through: class Class1 { /// <summary> /// The main entry point for the application. /// </summary> [sTAThread] static void Main(string[] args) { GetFiles("E:/"); GetSubFolders("E:/"); Console.Read(); } static void GetFiles(string directory) { try { string [] files = Directory.GetFiles(directory); Console.WriteLine("Files in folder \"{0}\"", directory); foreach(string f in files) { Console.WriteLine(f); } } catch(System.UnauthorizedAccessException) { Console.WriteLine("Access not allowed to \"{0}\"", directory); } } static void GetSubFolders(string directory) { try { //Get files for this folder GetFiles(directory); string [] subFolders = Directory.GetDirectories(directory); foreach(string sf in subFolders) { GetSubFolders(sf); } } catch(System.UnauthorizedAccessException) { Console.WriteLine("Access not allowed to \"{0}\"", directory); } } } -
Appreciate it guys... I'm just really head strong on good documentations coming with a product and I expect more from Microsoft than some README.TXT file... I know Access is severly limited, but it's what I'm accostomed too, but I know I need to transfer my knowledge to the SQL side if I'm ever going to do anything large scale. I'll read up on that link and get back with you if I have any more questions.... thanks, and Derek, trusted connection failed (this is the same account I used to install it with)... probably since I didn't read the install doc fully I skipped something important and will have to re-install it, but we'll see... serves me right for being in a rush. :/
-
Get files in folder and all sub folders
bri189a replied to dannyres's topic in Directory / File IO / Registry
To search all the files on a computer would make your Access table very large, if nobody has gotton back with you tonight I'll work up an example in the morning. May I ask why you would want to keep all that info in a database? As I said, that's a lot of information to track, especially if your starting at the root and going through every sub folder until you hit bottom. Also are going to want to track the full path, or just files names and where they're located doesn't matter. There might be an easier way to do whatever it is your trying to accomplish is what I'm saying, it's been on a very rare occasion that I needed to go through a files system, and even then it was more of for a search rather than for tracking purposes, then that location would be saved in registry value or a file. -
I knew there was reason I always use MS Access db's.... grrrrr... So I have C# 2003 and decided for my own sadistic reasons that I'd start using MSDE instead of Access... so I went and downloaded the package, up-packed it, quickly skimmed through the file to get the command line parameter to install it and apparently it installed since the service is now running. Going to 'Server Explorer' I type in my computer (and tried localhost for the fun of it) and tried using 'trusted connection' and entering SA with the password I created when installing MSDE and everything comes back with Access denied. MSDE is very user unfriendly apparently and Microsoft spared no expense at putting out a wonderful 6000 line text file that doesn't tell you anything useful... well maybe it does, but whose going to read a 6000 line document? Any ideas?
-
You could use the BringWindowToTop of function of the Win32Api, or possibly a combination of Win32Api functions to get the results your looking for. Look up API-Guide 3.7 on Google to get a pretty basic program explaining the Win32Api functions... it for VB6, but if you know VB6 you can upgrade it to your current language, whatever that is. Good Luck!
-
Still would love to have some help on this if any of you have any ideas...
-
your code: Dim myParentForm As Form2 'The below creates a NEW instances of Form2. If you 'have Form2 open you now have two Form2's, the one which 'you original had opened and this new one. myParentForm = New Form2 'To prove that there are two Form2's myParentForm.Show() 'And then your code myParentForm.cboMarks.Item.Add("something" 'will show up on this new Form you just made visible You have to understand that talking between forms isn't going to be as forgiving as it was in VB6. Your code is working just fine, it's just your implementation of it that is incorrect.
-
Abbacabba - So then my post was actually pretty acurate... wonders will never cease!
-
as divil said, time trial versions are easy to circumvent. Trust me, not that I've ever done it, especially those like Rdstne mentioned. The harder time-trial ones to mess with are the ones that use an encrypted reg key in conjunction with a hidden file, or files. Users are quick to look in the registry for changes but leary of messing with a coded file (of junk) that at 974 and the 1078 byte have the value that equal the number of days it's been used. The key is to make that file look like it's used for something so they don't mess with it. A determined user will still figure out and as divil said the best option sometimes is just not to have the options there to begin with, but sometimes that isn't a realistic option when your trying to sell a product. Good Luck.
-
Sam, I just started getting into ASP.NET myself, so I'm no expert in the subject. It's been a weird transition for me; I use to do a lot of IIS Web Apps in VB6 before moving to C#. The documentation I've read imply's (and from what I've experimented with so far it seems true) that the old fashioned building of static html with your ASP code is pretty much now obsolete with ASP.NET; in other words you should only see on extremely rare occasions the old <%= blah %> signs. Also if you use these tags, .NET starts up the old ASP .DLL file (which is going to cost you time), ASP.NET (ASPX) uses a differant DLL and it only allows the old <%= blah %> signs for backwards compatiblity and I think that is probably where you lag is coming from? Again I'm not an expert (yet), but I'm one of those that really reads up on stuff as I learn it, so take it for what you will, I'm still in the midst of learning it.
-
I love .NET. I love Microsoft. I love all the help files that keep me from polluting this board with all but the more difficult questions (wish others had that mentality). I used to do VB6 before .NET; I thought it was cool at the time. Then my friend told me about C#. Something C based but not so intemidating as C++. I did take a C++ course once, got a 102% as a final grade (extra credit)... but I didn't pursue it. I don't miss messing with pointers, function declaration, worthless help files that basically give you the syntax and if your lucky that syntax is correct. I don't know how many time the help file would tell me that it was looking for an address and I'd get an invalid parameter run-time error, but once I changed it to a pointer or a static object it worked just fine, or some crap like that. Yes C# is the ultimate language for me. Low-level enough to do cool things and keep the idiots out, but high level enough that you don't spend a day just get the objects on your window to show up, much less work correctly. Now C++ (and Assembly for that matter - yes I fiddled in that a little bit for fun) are something I play with as a hobby. C# is what I moonlight with. Thank-you Microsoft! -Microsft Tool :)
-
a .NET IDE by itself is only $100, why would anyone who is serious about programming want to waste time with something that more than likely is going to be bugging and have worthless help files if any. -Microsoft Tool :)
-
from what I understand is this, and someone please correct me if I'm wrong. A lot of people (including myself) do things such as: Console.WriteLine("The value of X = " + x.ToString() + "!") Not a big problem there, but a more advanced application may have: string ret; for(int x=0;x<variable.Length;x++) { ret += ";next value=" + variable + " and is " + boolVar.ToString(); } Over a larger iteration this is much more work for the processor than having: string ret; for(int x=0;x<variable.Length;x++) { ret.Append(";next value=" + variable + " and is " + boolVar.ToString(); } now I heard that second hand, but it's something to think about if it's true.
-
Get files in folder and all sub folders
bri189a replied to dannyres's topic in Directory / File IO / Registry
GetDirectories will get all the directories within a directory, with GetFiles you have all the information you need.... are you trying to do it in once sentance or something? -
Do you mean like in Domain Groups?
-
You're not stuck with MDI forms, you'll just have to be creative. Create your own tool bar and a global variable that hold all the form names. On each form add to the load event some code to add the name of the form to the global variable, and on the unload removes it. Then on the onClick event for the Window toolbar, have it populate it's sub-menu's with the Name property of each of the forms, and then manually add the event handling for the forms. I did that back in my VB6 days, but since I've gone CS I've had no need to do such a thing (not saying I won't someday), but the concept is the same and should work for you just fine. There might be a better method, so keep your eyes open.
-
Don't try to make sense of this (the why), there is a purpose to it (I need the how).... I know .NET supports UNC paths for savings, deleting, blah blah, but the problem is you have to know both the computer name (or IP) and shared folder. Not a problem 99% of the time. The particular application I'm making though is suppose to go through the network and get all the computers within an IP range which I've done below: //(string) ipaddress holds an ip-address is standard number //format. I use a search range (ex: 169.0.0.1 - 169.0.0.255) //prior to this code snippet in a loop incrementing the last octet IPHostEntry hostInfo = Dns.Resolve(ipaddress); Console.WriteLine("Computer: " + hostInfo.HostName); Later, once I figure out the next piece of the puzzle rather than simply displaying the computer name I will be using it to search for shared folders, all of this information will go into a database for later use. As you may or may not know you can't use the GetDirectories function because you will get an error (UNC paths must be in the format of //servername/share) - so I've been beating my brain out on this all day and I'm burnt; any ideas? Am I doing this the hard way for resolving IP address to common name? I've gone from really trying to find an answer exactly to randomly picking help files that are remotely close, all to no avail, so now that I've gotton to the I give up point... here I be.... Thanks, Brian
-
So today I thought I would start upgrading myself from ASP to ASP.NET - cool stuff. Anyway though I get the access denied error when trying to debug. If I start without debugging everything works fine... but I need the debugger. If I log on to my machine as an Administrator I don't have a problem, it's just my regular user account which is a part of the VS_Developers and VS_Debuggers group. These groups have full control access of the entire drive my inetpub is on (I don't like it being in the default of C:). So access shouldn't be a problem but is. I search for similiar problems and found lots of results, but nothing that fixed my problem. All the accounts have the appropriate permissions, the machine.config file is correct (I even tried changing the username to "SYSTEM" from "machine" as in one post but no help, I've reinstalled .NET, re-registered IIS, nothing works. It will be a pain in the rear to have to do all my ASP.NET work from the administrator account, and I don't really want to as I'm one of those who believe the administrator account is for administration, not day to day use. Any ideas that aren't already what I mentioned let me know; also one quick thing, if it's in the HELP file you get when you press help with that error, I've tried it too - I'm very frustrated by this. THANKS! Brian
-
I know what your talking about, I've done it in the past, just can't find the code, check MSDN under the window or document object; one of those if I remember right has a property for the previous page... sorry that's all I got, someone I'm sure will give you the exact though.
-
Me.Bounds should, it's in C# and they both use .NET and the Bounds property is part of the Control namespace (System.Windows.Forms), which you must have to have any forms... and this is the fully qualified name for Screen: System.Windows.Forms.Screen If nothing else Bounds is just a rectangle, do you have a Me.Rectangle? I'll wipe the dust off my VB.NET app and find out for sure tonight and try to remember to get back with you and get it to work for you, and Nerseus, one possible idea is what I use it for - sloppily thrown together games! :) Brian
-
The binding made a differance between office versions? Interesting..... glad to hear you got it though... early/late binding snagged me a few times in the past too.
-
try Dim myApp as Object Set myApp = Excel.Application Been awhile since I done that; think that should get you where you want to be.
-
something that detects hardware when inserted is best left to Microsoft. Your talking very low level programing there... lots of Win32Api calls if not and more than likely even lower (straight C++ or Assebmly).