
Nate Bross
Avatar/Signature-
Posts
609 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nate Bross
-
I think that what you really want to do is have your SQLGuardian.exe application run as a service. That way you will not need to be logged in, as PD said, you should write the windows service to _do_ all the work, and write a winforms application to communicate with the service and tell it what to do.
-
Where does your picture come from? Is it static? (exists as a file somewhere) or is it dynamic? (is generated on the fly) If it is static, you should be able to load in a few rectangle objects behind the words in the picture and set the tooltip on the rectangle object.
-
Couldn't you use multiple rectangles per word? Or is the image generated dynamically?
-
This code If TextBox1.InvokeRequired Then Dim LogsafeSub As New tbCall(AddressOf processRP1) TextBox1.Invoke(LogsafeSub, TextBox1) Else Is making the sub processRP1 execute on the same thread that TextBox1 was created (the UI thread).
-
Once you detect a collision you must then set the position of the moving object exactly next to the stationary object.
-
Adding column and data to an EXISTING datagridview
Nate Bross replied to massoud12345's topic in ASP.NET
Adding a column and data to a gridview should be easiy; the question is do you require updating the database schema as well? -
So I have a Linq2SQL type that is the return type for a method. This works fine; except the lazy loading is causing me issues since I'm returning the method via WCF. I have been able to use DataLoadOptions to get the related data I need; however it generates some HORRIBLY inefficent SQL, especially since I'm trying to filter 2M records down to about 20. It takes over 15 minutes for this query to execute. So I'm trying to manually select the data and populate my own instance of a Linq2SQL type. I run into this error: "Cannot convert IQueryable<T> to EntitySet<T>." I started trying to use an anonymous type, but alas I cannot convert from my anonymous type back into my Linq2SQL type. Am I screwed? is there away to convert between Anonymous Types / And or IQueryable<T> to EntitySet<T>? or do I need to create my own classes that reflect my Linq2SQL classes? Any help is appreciated; I can post relevant code if it'd be helpful.
-
Can you post the code that you have? I hope you aren't using a table for layout and this is some TABular data that you are using. I'm not sure what an aspx table is; a normal table tag, with a runat="server"? You may want to try something like this: <table id="myTable"> ... </table> #myTable{ width: 500px; height: 400px; padding:0; }
-
Download Mail Attachment using POP3 in C# winforms
Nate Bross replied to Prashus's topic in Windows Forms
I've used this as a starting point to understand how to process pop3 data. http://www.codeproject.com/KB/IP/despop3client.aspx You should be able to use that as a launching point. -
Can you post a screen shot of the text you are talking about? Most of the configurable text is available in the Install Wizard Pages (form Setup/Deployment Project). The Title is the name of your solution, IIRC. In terms of the Window Title, that displays at the top and in the task bar, I don't know if you have control over that...
-
I'd say KIS and use StringBuilder if all you need is simple text replacement; however, if you need to produce standards complient output; the XmlDocument may be a good option. I don't know if this would apply in your situation, but would an approach like this help you: http://haacked.com/archive/2006/11/29/Express_Yourself_With_Custom_Expression_Builders.aspx
-
As PD mentioned, MEF is developed by Microsoft, and open-sourced on codeplex. I have not used it; but everything I've heard about it is good. IIRC the Visual Studio team is using MEF as part of VS2010. (don't quote me on that though). Scott Hanselman has a podcast with one of the developers of MEF: http://www.hanselminutes.com/default.aspx?showID=166
-
I ended up setting up IIS Smtp Relay service inbetween. So now my application talks to IIS, which in turn talks to the mail server. Its not pretty, but it works for me.
-
This method uses alot of unmanaged code, but will probably be very fast: http://www.developerfusion.com/code/4630/capture-a-screen-shot/ This code will get the image into a BitmatpSource (for use with WPF .Net 3.0/5) Bitmap bmpScreenshot; Graphics gfxScreenshot; // Hide the form so that it does not appear in the screenshot this.Hide(); System.Threading.Thread.Sleep(1); // Set the bitmap object to the size of the screen bmpScreenshot = new Bitmap((int)System.Windows.SystemParameters.PrimaryScreenWidth, (int)System.Windows.SystemParameters.PrimaryScreenHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb); // Create a graphics object from the bitmap gfxScreenshot = Graphics.FromImage(bmpScreenshot); // Take the screenshot from the upper left corner to the right bottom corner gfxScreenshot.CopyFromScreen(0, 0, 0, 0, new System.Drawing.Size((int)System.Windows.SystemParameters.PrimaryScreenWidth,(int)System.Windows.SystemParameters.PrimaryScreenHeight), CopyPixelOperation.SourceCopy); // Save the screenshot to the specified path that the user has chosen BitmapSource bitmapSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bmpScreenshot.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); imx.Source = bitmapSource; //bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png); // Show the form again this.Show(); Otherwise, this code will probably work if you just want a Bitmap object: Bitmap bmpScreenshot; Graphics gfxScreenshot; // Hide the form so that it does not appear in the screenshot this.Hide(); System.Threading.Thread.Sleep(1); // Set the bitmap object to the size of the screen bmpScreenshot = new Bitmap((int)System.Windows.SystemParameters.PrimaryScreenWidth, (int)System.Windows.SystemParameters.PrimaryScreenHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb); // Create a graphics object from the bitmap gfxScreenshot = Graphics.FromImage(bmpScreenshot); // Take the screenshot from the upper left corner to the right bottom corner gfxScreenshot.CopyFromScreen(0, 0, 0, 0, new System.Drawing.Size((int)System.Windows.SystemParameters.PrimaryScreenWidth,(int)System.Windows.SystemParameters.PrimaryScreenHeight), CopyPixelOperation.SourceCopy); this.Show();
-
I had a similar issue; I thought I could save myself alot of time using this: String[] files = System.IO.Directory.GetFiles("C:\\", "*.*" SearchAll); This will throw a UnauthorizedAccessException() on operating system hidden folders (even if you have them turned off) The only solution I found was this: List<String> files = new List<String>(); void DirSearch(string sDir) { try { String[] dirs = System.IO.Directory.GetDirectories(sDir); foreach (String d in dirs) { String[] files = System.IO.Directory.GetFiles(d); foreach (String file in files) { try { Files.Add(fd); } catch (System.IO.IOException ioex) { // } catch (System.UnauthorizedAccessException uaex) { // } } DirSearch(d); } } catch (System.Exception excpt) { Console.WriteLine(excpt.Message); } }
-
For future reference, you'll typically get a better response if you ask for someone to point you in the right direction to either convert the code yourself, or purchas a software package to help you do it. You will always get a better response if you ask for help instead of asking for someone to do your job for you.
-
You didn't post this, but I suspect you have code that looks something like this (correct me if I'm wrong) int[] myIntArray = {1,2,3,4}; ArrayList myIntArrayList = new ArrayList(myIntArray.Length); myIntArray.CopyTo(myIntArrayList.ToArray()); This code will not work, because you cannot set the value of a method: // this will never work myObject.SomeMethod() = 245; Now, depending on the version of .Net you are using, ArrayList may not be the best option. You may be better served with a List<T> or a Generic List. If you are on Pre .Net v2.0 you'll need to use the ArrayList like this: int[] myIntArray = {1,2,3,4}; ArrayList myIntArrayList = new ArrayList(myIntArray); By passing in the the Array into the constructor of the ArrayList (one of the overloads accepts a collection) the ArrayList should pickup each value of the collection. If you are using .Net v2.0 or later, you can use a Generic List, or a strongly typed list as follows: int[] myIntArray = {1,2,3,4}; List<int> myIntList = new List<int>(myIntArray); String[] myStringArray = {"1", "2", "3", "4"}; List<String> myIntList = new List<String>(myStringArray); It is possible, and recommended to use your own storngly typed collections even in .Net 1.0/1.1 see this link for further information http://www.ondotnet.com/pub/a/dotnet/2003/03/10/collections.html The advantage of the Generic List (or strongly typed list) is that you cannot mix object types that are in your list/collection. HTH
-
Scott Gu is a good blog to follow; as well as Scott Hanselman mostly .Net intermixed with other technical stuff. I find his blog very interesting. He's also got a weekly podcast which I've just started listening to -- also very good stuff.
-
String shortFileName = longFileName.Replace(' ','').Substring(0,7) + "." + System.IO.File.GetExtention(longFileName); You may want to check the return of GetExtention() it may include the period. But thats the idea. Assuming you want a fixed length; otherwise you could just use .Replace("lower",String.Empty);
-
As PD sugested, you should try installing 2.0 and see if it detects a newer version.
-
Checkout SmallestDotNet.com -- it will detect what you have, and give you a link to the smallest download available from Microsoft to get you up to date.
-
There are two problems with your code; first you are dim[ing] assigneeX, and setting personX = "guyX" that will cause an issue right there. Secondly is variable scope, when you define variables in the scope of a method; they are disposed of by the time the next method executes. Try defining the variables outside the method (but inside the class) and then access them by the names you defined. I also recommend for Visual Basic to put these two lines on top of EVERY code file. Option Strict On Option Explicit On
-
A simple way to think about it is that an Interface is like a contract. Any class that implements or extends an Interface is guarenteed to implement all members of the Interface, it may have more, but it will have everything defined in the Interface.
-
http://www.codeproject.com/KB/audio-video/MIDIToolkit.aspx Is probably worth a read.
-
Can you post the code that isn't working?