Jump to content
Xtreme .Net Talk

decrypt

Avatar/Signature
  • Posts

    222
  • Joined

  • Last visited

Everything posted by decrypt

  1. Thanks for the link, I finally understand how statics work and it's just what I was looking for :P
  2. But how could I access that object from anywhere in the project once it's created? Would making the object static allow me to do this? Say I create a string in the main form and I have about 5 classes in the project. How could I make it so that that string could be accessed from anywhere in the project without having to pass it or it's parent into all of the classes? Is there a way to sort of do something like this: Form 1: global string gHello; gHello = "test"; Class 1: MessageBox.Show(gHello); //outputs test I'm trying to ask this as simply as possible using a string. I guess I'm sort of going away from object-oriented programming. I could live without the luxury of being able to do this if it's not possible. It's just it would make things a lot easier if it is.
  3. This should hopefully be an easy question to answer. Basically what I want to know how to do, is how to create an object that can be accessed in any class in the project without having to actually pass it into every single class. At the moment I'm creating the object in the main form and then passing that object into a class' constructer. When I have one thing that keeps getting passed into a bunch of classes it starts to get confusing. Is there something like an include file in c#.net so that I could just define it in there and use it throughout the project? Is there an easier way to do this?
  4. Nevermind after a long time trying to figure this out I have finally figured out what i did wrong. First of all, i wasn't supposed to edit the machine.config file, but rather the Web.Config file that I created in the root directory of my website. Second, I had to do <COMPNAME>\SQLEXPRESS for the Data Source, and the last thing I had to do was in the Database explorer select the aspnetdb. edit: I was supposed to put this in the Web.config file: <connectionStrings> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="Data Source=<comp name goes here>\SQLEXPRESS;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings>
  5. Get the page's html and then use an xml parser instead of regular expressions. I've done it before in php and it worked pretty well :P
  6. I'm trying to get the Web Site Administration Tool (WSAT) to run with asp.net 2005 express edition and sql 2005 express edition. The problem I'm running into however is that I get the error message "An error was encountered. Please return to the previous page and try again." when I start up WSAT and that's all the information that it gives me. I followed the tutorial at http://www.asp.net/guidedtour2/s27.aspx. I ran aspnet_regsql.exe and completed that installation, but afterwards it says "After running the wizard you will then need to change the Provider via the WSAT. You can also implement the Provider API for a custom data storage solution and use the WSAT to manage settings." of course I can't do this because WSAT doens't work. I also tried editing the machine.config to say: <connectionStrings> <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;[b]Initial Catalog=aspnetdb;[/b]Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> (aspnetdb is the database that aspnet_regsql.exe created) instead of: <connectionStrings> <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> But that didn't work at all. btw, I don't have IIS. Does anybody know the solution for this? Thanks, decrypt
  7. Well after trying to figure it out again for a couple of hours I finally figured it out. With BULK INSERT you completely leave off the 0x. Hopefully this helps somebody else out in the future who did not realize this either. Also make sure it's an even number of characters. I tried it multiple amounts of times without the 0x, but I guess I had an uneven amount of characters. *PROBLEM SOLVED*
  8. I'm getting an error while trying to load some data that includes a binary field into a database. Doing a INSERT INTO works fine, but doing a BULK LOAD doesn't. How could I fix this problem? Do I have to specify any additional information in the BULK INSERT command? Command: File Contents: (temp.txt) The binary field is the final field (col 2) Error Message: Thanks for the help. Edit: btw, i'm using SQL Server 2005 Express
  9. I'm trying to read text out of google talks chat window, but I can't seem to figure out how. This is my current code: [DllImport("user32.dll",EntryPoint="FindWindow")] public static extern int FindWindow(string _ClassName, string _WindowName); [DllImport("user32.dll",EntryPoint="FindWindowEx")] public static extern int FindWindowEx(int hWnd1, int hWnd2, string lpsz1, int lpsz2); [DllImport("user32.dll",EntryPoint="SendMessage")] public static extern int SendMessage(int _WindowHandler, int _WM_USER, int _data, int _id); [DllImport("user32.dll",EntryPoint="SendMessage")] public static extern int SendMessage(int _WindowHandler, int _WM_USER, int _data, string _id); [DllImport("User32.dll")] public static extern bool SetForegroundWindow(int hWnd); public void GetText() { int Handler = FindWindow("Chat View",null); if (Handler > 0) { int Alt = FindWindowEx(Handler, 0, "AtlAxWin71", 0); if(Alt > 0) { int IES = FindWindowEx(Alt, 0, "Internet Explorer_Server", 0); if(IES > 0) { MessageBox.Show(SendMessage(IES, (int) WMDefs.WM_GETTEXTLENGTH, 0, 0).ToString()); SetForegroundWindow(Handler); } else { MessageBox.Show("Cannot find IES"); } } else { MessageBox.Show("Cannot find alt"); } } else { MessageBox.Show("A Google Talk chat window is not open","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } } The text length is 0. Is there a way to get the text out of the chat window?
  10. hmm... do you think there is anyway to load the materials colour instead of loading in the texture from the file?
  11. Oh, that seems to make sense. I'll try that. One more question though, is that when I load the mesh will it load those textures, do I have to somehow get the path of the bitmaps from the .x file and load them in? Edit: btw, when I view it in the directx view it views to colour.
  12. I created the file in blender with the textures on it (that are just colours). I import it and I get a white mesh that isn't textured. How could I texture it from the information in the file?
  13. Ok, I've had enough of searching around on the internet for how to do that. How would I be able to texture the following .x file of mario? I want to use three colors to do it mario_stand.txt
  14. I want to be able to load a mesh into vs.net without having to define the textures at all, but use the texture information in the .x file. I am using the code at http://www.xtremedotnettalk.com/showthread.php?t=95349 . How would I be able to load a mesh file into vs.net by using the texture information in the .x file? Answer in either c# or vb.net Thanks a lot in advance, decrypt
  15. never mind, i got it working. I did something similiar to what is on this page: http://www.developerfusion.co.uk/show/3077/2/
  16. I have a datagrid that loads an xml file into it using a DataSet. The problem that I have, is that I cannot figure out how to get a DataView to work with it so I can set it's allownew property to false. How can I use a DataView along with a DataSet that has a loaded xml file in it?
  17. It works perfectly. Thanks a lot :D
  18. wow, thanks a lot :)
  19. I'm trying to make control that contains panels of buttons that can be moved around inside the control. How could I make the panels movable by the user?
  20. wow, thanks a lot. That worked perfectly :)
  21. I'm getting information out of an html document. Here is the html: Text here <STRONG>Info:</STRONG> <b>Information</b> here.<BR><STRONG>hello</STRONG><BR> ... Text here <STRONG>Info:</STRONG> <b>blahblah</b><BR><A HREF="blah.html">MORE</STRONG><BR> ... Text <STRONG>Info:</STRONG> more <b>stuff</b><BR>HELLO<BR> ... Text <STRONG>Info:</STRONG> more<b>stuff</b><BR><IMG SRC="image.jpg"><BR> I want to be able to find just the "<STRONG>Info:</STRONG> Information changes in <b>here.</b><BR>" and nothing else on the line. I've tried different things like the following: (<STRONG>Info:</STRONG>)(?!<BR>).+<BR> It will then get: <STRONG>Info:</STRONG> Information <b>here.</b><BR><STRONG>hello</STRONG><BR> instead of <STRONG>Info:</STRONG> Information <b>here.</b><BR> (which is what i want) Thanks in Advance, decrypt
  22. you could just use the Document Object Module (you need to import the Microsoft MSHTML reference): Dim I As Object Dim WDoc As HTMLDocument Dim Wlval As HTMLAnchorElement Dim nelements As Short Dim sHref As String Dim sTitle As String Dim sText As String WDoc = WebBrowser1.Document nelements = WDoc.links.length For I = 0 To nelements - 1 Wlval = WDoc.links.item(I) sHref = Wlval.href sText= Wlval.outerText sTitle = Wlval.title lstbox1.Items.add(sHref) 'to see if it ends with a .jpg, you could just do the following: If sHref.EndsWith(".jpg") Then lstBox2.Items.add(sHref) End If Next By using this you can get soo much information about a webpage :)
  23. Does anyone know of any good Jabber/XMPP examples or tutorials? I've been looking on google for quiet some time now, but havn't found anything useful... Thanks in Advance, Decrypt
  24. Thanks a lot! here is the code: LN = UserInput - 1 'you have to do this, otherwise it will select the next line X = 0 Do X = txtMain.Text.IndexOfAny(System.Environment.NewLine, X + 1) LN -= 1 Loop Until LN = 0 txtMain.Select(X + 1, 0) 'do this so it doesn't select the end of the line before
  25. I finally got round to trying this out (because I've been gone on holiday). What I really want to do is have an integer, and go to the line of the inputed integer. It's sort of like when you press ctrl+G in microsoft word, notepad, etc..
×
×
  • Create New...