Jump to content
Xtreme .Net Talk

joe_pool_is

Avatar/Signature
  • Posts

    512
  • Joined

  • Last visited

Everything posted by joe_pool_is

  1. I like that idea a lot, actually! Thanks! That isn't the first time you've given me some good ideas on here, either.
  2. Rats. I meant to update this thread, but I never got around to it. Editing with Orca solved the problem: In the Control table, I searched for all BannerText Controls and removed the text shown in their "Text" properties. The problem is that Visual Studio does not allow editing these fields. I would imagine this is to promote others to buy products like Install Shield, etc. Screen Shot: http://lh3.ggpht.com/_dWwXockqCZk/SeNnHefiYdI/AAAAAAAABek/wPQJbewWuCU/screenshot.PNG
  3. That got me on the right track. Thanks DP.
  4. I'm interested in creating an event in my inherited class. Given this: public abstract class ZBase { string _test; public ZBase() { _test = string.Empty; } public string TestString { get { return _test; } set { _test = value; } } } public class MyData1 : ZBase { public enum DbType = { None=0, This=1, That=2 }; DbType _type; public MyData1() { _type = DbType.None; } } public class MyData2 : ZBase { public enum DbType = { None=0, Here=1, There=2, Expired=4 }; DbType _type; public MyData2() { _type = DbType.None; } } I want to add some kind of event handler that can react whenever TestString is set. Example1: MyData1 data1 = new MyData1(); data1.TestString = "I am that"; Now, with some event handler, data1's _type should be DbType.That. Example 2: MyData2 data2 = new MyData2(); data2.TestString = "I am here"; Now, with some event handler, data2's _type should be DbType.Here. The event handler would parse the text in the string using something similar to this: // some kind of event handler: if (-1 < TestString.IndexOf("that")) { _type = DbType.That; } I don't know how create an event handler for a variable, though. Obviously, the class I'd use this for is a little more complicated than that. The enumeration would be a type of product, type of employee, type of business, type of process, etc. I appreciate your help. ~Joe
  5. Thanks Derek, This is an ongoing project that I occasionally get a call to do some fixes or updates to (you are welcome to take over, if you are interested). I tried removing these lines, thinking they were comments, and the page simply did not work. I new there was something else involved, but symbols (like <!-- --> and <%-- --%>) are difficult to look up in a search engine.
  6. My client wants me to get rid of Microsoft's default text in the Title of the installer (MSI). Instead, they want me to use their custom banner bitmaps. I am easily able to include each banner on each different page of the setup project, but how do I get rid of Microsoft's text? I don't care if it is hidden, set to an empty string, or anything else. It just should not be seen. I'm fine editing the MSI with ORCA, but I don't know what needs to be edited. Thanks for Helping! ~Joe
  7. [PLAIN][RESOLVED] GoDaddy Download Help[/PLAIN] I may have come across the solution, though my understanding of it could be somewhat flawed. I invite someone that knows to point out what is really going on here. I spent some time looking at a Blog on MSDN referenced here: http://blogs.msdn.com/petel/archive/2005/12/01/499189.aspx From what I was able to gleam, the default MIME type that Windows Servers use with the HttpContext object is "Text". The Windows Server attempts to interpret other file types based on that file's extension. I looked up a list of HttpContext MIME types (Ref: http://www.webmaster-toolkit.com/mime-types.shtml), and noticed that ISO files do not have an entry. My theory is that any attempt to download an ISO file from a Windows Hosted website will fail. My understanding is that whenever I renamed the ISO file to have no extension, the Windows Server used the default file type of Text. Whenever I clicked on the [A HREF] link to download the file, the Windows Server was unable to locate the Text file - hence the message "File Not Found". I could be wrong, and I am positive I am not 100% accurate. I invite someone who knows a little more to give me/us the rest of the story.
  8. I uploaded a file onto one of my free Windows Hosting account on GoDaddy located at http://www.poojo.com. The file is "FleetWhiz.iso", created for my partner in another part of the country, and it is 70 MB in size. In a page labeled "Default.aspx" in a folder called "test", I placed a link to this file so my partner could right-click the file to save it to his PC. The link in "test/Default.aspx" does not work. It says that the file was not found, even though FileZilla shows it sitting on my remote server. Thinking ISO files might be suspect, I renamed it "FleetWhiz_iso" (with no extension), and updated my link accordingly. Again, I get that there is no such file whenever I try to download it. I contacted GoDaddy about this, and their response was a generic "can't help - why not purchase this package instead" answer(see quote below). Does anyone know how to setup a GoDaddy site for file download? File downloads should be basic, and should not have to be configured, I'd think. If it helps... Here is the actual page: http://www.poojo.com/test/ Here is the file's location: http://www.poojo.com/test/FleetWhiz_iso (Note: Due to quota restrictions, though, this file won't stay there for long.) Any help is greatly appreciated. Regards, Joe
  9. I need a way to add the total number of pages in a document to the PrintDialog: PrintDocument printDoc = new PrintDocument(); void GenericFn() { PrintDialog pd = new PrintDialog(); pd.Document = printDoc; pd.PrinterSettings.FromPage = 1; pd.PrinterSettings.ToPage = 1; // how do I set this value from printDoc? pd.ShowDialog(); } I'm using this DataGridViewer Printer class that nicely handles sending all of the code from the DataGridViewer to the printer using PrintDocument.PrintPage and PrintDocument.BeginPrint routines, but the code doesn't have a way to determine how many pages are in the entire document. Is anyone here skilled in this? I'd like my operators to be able to select only 1-5 pages to print, or cancel when they see it contains 115 pages, etc.
  10. Hi Kulrom and thanks for the reply. This is the closest I seem to be able to get as well. The problem is, I want to collect the Key "A" and not the Key "Ctrl". In other words, with the Control key pressed, all text entered should populate the textbox control and "look like" the Control key is *not* being pressed.
  11. I need to write an "easter egg" into our application. It is designed to eliminate keystrokes, and it works great. This forces our application to use the hand held scanners that are plugged into the COM port. (If reading the COM port fails, we do not suppress the keystrokes) However, occasionally someone in the IT department needs to remote in to do some diagnostics from another computer. If KeyEventArgs.SuppressKeyPress = True, no one can operate the application remotely. I'm looking for a good idea here. I tried using the Alt key to signal that I want to bypass the Suppress feature, but then the Alt+(whatever was pressed) is unrecognizable by the system. Example: Say someone wants to enter their badge number: 123456 or log out of the system using the barcode text "LOGOUT". They should use the handheld scanners. I want to enable keystrokes somehow, either if a special key is pressed (which seems like it would be easy to leak that information out) or some other technique. Does any one know of a way to accomplish this task?
  12. Are the following lines comments or exectuable code in an ASP.NET file? <!-- #include file='~/imageswap.html' --> <!--<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/About/BrucesBrew.aspx"><asp:Image ID="WhatsBrewingPhoto" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPhoto01.jpg" BorderWidth="0" /></asp:HyperLink> --> <%--<asp:Image ID="WhatsBrewingLS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingLeftSpacer.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingPrevious" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPrevious.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingNext" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingNext.gif" BorderWidth="0" /><asp:Image ID="WhatsBrewingRS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingRightSpacer.gif" BorderWidth="0" /><br />--%> I'm supposed to be fixing this ASP.NET site that someone else built and we don't have the project for it. But I honestly don't know that much about the technology.
  13. Hmmm... CS code formatting looks horrible, doesn't it? Let's try it this way: string path = string.Format(@"[url]ldap://DC={0},DC=local[/url]", txtDomain.Text); string user = string.Format("{0}.local\\{1}", txtDomain.Text, UserNames.Text); try { DirectoryEntry rootEntry = new DirectoryEntry(path, user, txtPassword.Text); DirectorySearcher Searcher = new DirectorySearcher(rootEntry); Searcher.PropertiesToLoad.AddRange(new string[] { "cn", "mail" }); Searcher.Filter = string.Format("(&(anr={0})(objectCategory=person))", UserNames.Text); SearchResultCollection Results = Searcher.FindAll(); foreach (SearchResult result in Results) { Console.WriteLine("Name = " + result.Properties["cn"][0] + ", E-mail = " + result.Properties["mail"][0]); _adName = result.Properties["cn"][0].ToString(); } } catch (Exception err) { Console.WriteLine(err.ToString()); }Not as pretty, but at least you can read the correct text.
  14. I got it to work (though I don't really understand this cryptic stuff). If it helps anyone, here's what I used: string path = string.Format("[url]ldap://DC={0},DC=local[/url]", txtDomain.Text); string user = string.Format("{0}.local\\{1}", txtDomain.Text, UserNames.Text); try { DirectoryEntry rootEntry = new DirectoryEntry(path, user, txtPassword.Text); DirectorySearcher Searcher = new DirectorySearcher(rootEntry); Searcher.PropertiesToLoad.AddRange(new string[] { "cn", "mail" }); Searcher.Filter = string.Format("(&(anr={0})(objectCategory=person))", UserNames.Text); SearchResultCollection Results = Searcher.FindAll(); foreach (SearchResult result in Results) { Console.WriteLine("Name = " + result.Properties["cn"][0] + ", E-mail = " + result.Properties["mail"][0]); _adName = result.Properties["cn"][0].ToString(); } } catch (Exception err) { Console.WriteLine(err.ToString()); }
  15. I think the best you're going to be able to do is to add an auto refresh timer to your form and handle your changes by looking at the ASP.NET IsPostBack property. Web Browsers are specifically designed so that people can NOT access or externally control a program and its contents. However, you could write an application and have others install it. That is often how viruses are spread, though.
  16. I have some code that authenticates my users with Active Directory. An employee first enters their badge number, and if this badge number corresponds to an employee that is part of a secure group (Managers, Supervisors, etc.), that employee is required to authenticate who they are by entering their username and password. public bool Authenticate(string domain, string userName, string passWord) { string path = string.Format("[url]ldap://{0[/url]}", domain); string domUser = domain + @"\" + userName; DirectoryEntry entry = new DirectoryEntry(path, domUser, passWord); try { object nativeObj = entry.NativeObject; Console.WriteLine(string.Format("Username '{0}' Authenticated", userName)); return true; } catch (COMException e) { MessageBox.Show(string.Format("Username '{0}' Not Authenticated:\n{1}", userName, e.Message), "Authentication Failed"); } catch (Exception e) { MessageBox.Show(string.Format("Username '{0}' Not Authenticated:\n{1}", userName, e.Message), "Authentication Failed"); } return false; } This seemed to work fine until someone realized they could enter a supervisor's or manager's badge number, then authenitcate with their own username and password. I want to edit my authentication routine to allow me to get the name of the individual that was authenticated. From an Internet search, it looks like I need to use IADsGroup: IADsGroup igroup = (IADsGroup)entry.NativeObject; I tried a straight copy/paste of the above line, but 'IADsGroup' is not defined. Doing more research, I see that this is part of the IADs Interface, which inherits from IDispatch (MSDN: http://msdn.microsoft.com/en-us/library/aa705950(VS.85).aspx). I've never used interfaces before, and I don't know how to do what I want. Could someone please give me some guidance?
  17. My apologies, I found it: if (this.ContainsFocus == true) { // blah, blah, blah } Hope it helps someone else.
  18. In my MDI Child forms, how can *they* tell if they are the focused form? A few of my forms have timers that ensure it's single text entry field always has the focus, and sets the focus there if it does not. For simplicity, I'll call these AutoFocus forms as opposed to Standard forms. AutoFocus forms work great when no other form Mdi Child form is visible, but I am having problems in the other cases. In each of the AutoFocus forms, I have attempted to determine if that form is the active form, but I get nothing. // Code in AutoFocus forms: void Timer_Tick(object sender, EventArgs e) { // Here is one way I tried, but even // if the form itself is not visible, its // Visible property is still True: if (Visible == true) { // other code } // Here is another way I tried, but if // the Form's focus is on one of it's // containing Controls, it returns False: if (Focused == true) { // other code } } Does anyone even know what value I'm looking for? There has to be a way for the child form to determine if the parent is giving it top focus, but I certainly don't know what it is. Does anyone know how to tell this?
  19. I've got a buddy that gets a lot of website jobs. He does the PHP jobs, and sometimes (like this) he hands me the ASP jobs. This job involves a client that wants to move their website to a new host. From what I've been told, their web host provider is charging them close to $200 a month. They want to move their site to a new system or host it themselves. They are looking for options and pricing for the work and maintenance. Is anyone here interested in doing something like this? I've looked at it a little before. It has databases and some AJAX, and I just don't have the time to sit down and become immersed in their project. Here's the website: http://www.bluevalley.net
  20. That helped a lot! Thank you.
  21. I have a Windows VS2005 Form where my Clients can select a Start Date and an End Date. Obviously, the Start Date must occur before the End Date, or there will be problems, so I need to validate the entries. Where should I validate these controls, and how should this be done? I have existing code that validates the control and give the Client a friendly message box when it is incorrect when the DateTimePickerControl's ValueChanged event is fired: void DateTime_ValueChanged(object sender, EventArgs e) { if (sender is DateTimePicker) { if (dtEnd.Value < dtStart.Value) { string strCtrl = string.Empty; if (sender.Equals(dtStart) == true) { strCtrl = lblStartDate.Text; DateTime newVal = dtStart.Value.AddDays(-1); while (dtEnd.Value < newVal) { newVal = newVal.AddDays(-1); } dtStart.Value = newVal; dtStart.Focus(); } else if (sender.Equals(dtEnd) == true) { strCtrl = lblEndDate.Text; DateTime newVal = dtEnd.Value.AddDays(1); while (newVal < dtStart.Value) { newVal = newVal.AddDays(1); } dtEnd.Value = newVal; dtEnd.Focus(); } string fmt = string.Format("{0} must be less than or equal to {1}.\r\n\r\nYour {2} has been modified.", lblStartDate.Text, lblEndDate.Text, strCtrl); MessageBox.Show(fmt, "Invalid Date", MessageBoxButtons.OK, MessageBoxIcon.Information, 0); } } } If someone drops the Calendar down and tries to scroll to a month or year that is out of range, the GUI goes nuts with message boxes from my code until the system runs out of memory. I tried rewriting the code to only respond when the calendar scrolls back up, but then validation would fail whenever a date was manually entered in the textbox. How should I address this?
  22. Thanks for the link and the summary!
  23. I was adding a new form to an existing project in VS2005 the other day, and I took some time to look at all of the different types of objects I could include. One item in the list was an "Interface". I tried looking in the help under selecting items, but there was no information on what an "Interface" was. Could someone tell me what an Interface is?
  24. This old post got me going: http://www.xtremevbtalk.com/archive/index.php/t-239209.html For the most part, I've got a C++ file that still limits me to Win32 (example here): http://support.microsoft.com/default.aspx?scid=kb;en-us;165721 But, that still leaves me in Win32, and doesn't cover other OSs.
  25. I'm working on a USB application that will connect to our network, run apps, etc. When the device is plugged in, it will ask for the person's name and password, and give them access to the apps if that is correct. If the credentials are wrong, I want to eject the USB drive. Certainly, I want this to work with all Windows based systems, so this will be Unmanaged Code. Also, I would at least like the credentials checking tool to run a little if the device is connected to a Mac or a Linux box - if only to say, "You can't do this here!" before disconnecting the USB drive. Does anyone know where I could go to for information on this sort of thing? I would imagine the code needs to be written in C or C++. I don't know how to make sure what I develop is compliant with other Operating Systems, and I don't even know how to tell a USB device to disconnect in Windows - much less any other OS. I'm not really looking for answers - just directions and maybe some key terms to use in my search. Thanks, Joe
×
×
  • Create New...