Jump to content
Xtreme .Net Talk

bpayne111

Avatar/Signature
  • Posts

    335
  • Joined

  • Last visited

Everything posted by bpayne111

  1. now i'm confused... I thought different workgroups were only bad practice if you were trying to 'view workgruop computers' and even then you could use //servername/sharename. Am i missing something from the big picture here?
  2. please post more information about your issue. Have you stepped through the code to see which object is crashin the app? a little code always helps too. just out of curiosity why are you using 2 workgroups for just 3 machines? My guess is you are on a different workgroup at home maybe? --brandon
  3. I�m using c# to write the app but if you know vb.net that will be just fine. Most of my books are in vb.net anyway so I�ve gotten used to translating it. All of my code will be in c#.net unfortunately if that is the case. You can go here to convert c# to vb.net if you need/wish. This project initially was intended to aid us in establishing internet connections automatically at the stores for updates but, now I am just curious to learn the concept I am missing In my vpn adobe manual there is a very detailed description of the command switches that the client accepts. Two of the parameters (-h and �m); allow a programmer to supply a window handle and a message handle of his program to the vpn client. With these values the vpn will return a true value to the lParam of the message handle I supplied from my program. Some of my trouble comes from not fully understanding how message handles work. I have some groundwork on window handles but next to none on message handles. I�ve looked for documentation explaining the concept better but apparently have been searching for the wrong keywords. I hope all of that made since. Here is the code I wrote //Objective: to connect the vpn client and confirm a connection has been made using a message handle //connects vpn private void button2_Click(object sender, System.EventArgs e) { Message m = new Message(); vpn.Connect(this.Handle, this.WndProc(m())); if(m.LParam==true) MessageBox.Show("true"); //code inside the vpn object public static void Connect(IntPtr windowHandle, IntPtr msgHandle) { try { //run VPN Client and log in System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo(); ps.FileName="c:\\program files\\vpn.exe"; ps.Arguments="-h " + windowHandle.ToInt32().ToString() + " -m " + msgHandle.ToInt32().ToString() + " -s -u user,pw,12.345.678.90"; System.Diagnostics.Process p = new System.Diagnostics.Process(); ps.UseShellExecute=false; ps.CreateNoWindow = true; p.StartInfo=ps; p.Start(); } catch { } } First I�m not sure if I�m using the message handle object in the right way. Is there another way to do pass a message handle of my program to the Connect method? In the button2.click event you will see that I used an �if� statement to test for the value of the lParam. I am sure this is not the correct way to do so but throwing that inside an infinite loop doesn�t seem right at all. I�ve considered a sleeping thread but that seems like it wouldn�t be the proper way to do either. I�m almost positive these message handles work in some manner that would fire an event or something. There is a big chunk of the concept of these that I�m misisng I could check the ip address of the vpn network adapter from the registry but I wouldn�t learn anything from that so I gave it a thumbs down. I think (hope) that sums it all up pretty good. Any help? Brandon
  4. i'd like to use my apps handle and message handle as a switch in another process that i'm running from inside my app. ie process.start("3rdpartyapp -h 1234 -m 5678"); where h is my apps windows handle and m is a message handle supposedly this app will tell my app when it's 'connected' if i do this right. i'm about to hit the search now. i hope this post makes sense, i'll be glad to clarify thanks, brandon *****edit i guess i forgot to ask a real question here..... what do i return my apps windows message handle as an int32?
  5. I found this article that seems like it will do it but not in the way i thought i would be able to do it. I'd like to make just a standalone exe. http://support.microsoft.com/default.aspx?scid=kb;en-us;837220#introduction
  6. I need to create a shorcut to a webpage on the desktop programmatically. I've done a search on 'create desktop shortcut' I came up with http://www.xtremedotnettalk.com/showthread.php?t=87933&highlight=create+desktop+shortcut The end result in this thread was an error. It seems this has plauged a few people with no solutions. Anyone with the magical solution to this? thanks, Brandon
  7. why /c? i'm gonna try it now thanks, brandon
  8. I still get the same results as before... except for now the process is never closed. is this because i'm using a .com instead of a .exe?
  9. public void FormatDisk() { string temp=""; System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo(); ps.FileName="c:\\windows\\system32\\format.com"; ps.Arguments="a: "; ps.CreateNoWindow = true; ps.RedirectStandardOutput=true; ps.RedirectStandardInput=true; //ps.RedirectStandardError = true; ps.UseShellExecute=false; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo=ps; p.Start(); StreamWriter sIn = p.StandardInput; // try { //sIn.Write(System.Environment.NewLine); while(p.StandardOutput.Peek() != -1) { temp = p.StandardOutput.ReadLine(); //read stream Debug.WriteLine(temp); } sIn.Write(System.Environment.NewLine); while(p.StandardOutput.Peek() != -1) { temp = p.StandardOutput.ReadLine(); //read stream Debug.WriteLine(temp); } } catch(Exception err) { Debug.WriteLine(err.Message.ToString()); } p.Close(); Debug.WriteLine("process closed"); } when this code is run the output window only shows the following: Insert new disk for drive A: process closed any ideas on what's going on here? i'm pretty stuck at this point because i have no trouble with .exe's but .com seems to act funny thanks, brandon
  10. try using ctype to convert the icon to an image when you set the property. i hope that helps some brandon
  11. i decided i just HAD to make this one image transparent on the outside and and fade away before loading the main form for this program. yea yea i know we've seen enough of these posts around here (i tried searching first) so i get my form to be transparent finally by using a transparent gif as the background image on a form with no border and NO transparent key. When the form fading is added "this.Opacity-=.02;" the image gets a black box around it and is no longer transparent althoguh it does still fade away. i've tried all sorts of little techniques even this.PleaseStayTransparentPlease; any pointers to a thread i missed or just some a good tip would be nice. thanks, brandon
  12. eh well that would be my solution but i dunno how to send 'play' with sendkeys. so i'm stuck arrg brandon
  13. I think a few of us would kinda like this idea. Is it even possible? It sure would be cool if i could turn the media shortcuts on my keyboard to a few vs.net shortcuts. I always catch myself glancing for that f5 key and for some reason i still don't remember the stop shortcut. Moving these shortcuts to easier to hit keys on the keyboard is my plan. I think it would be cool as **** to let my Play; Stop; and Next Track; Previous Track keys on my keyboard to execute Run; Stop; Step Through; Start without Debugging commands respectivly. Obviously i can't find settings in the software to do something like this. So who's the man with the plan on this one? brandon
  14. hey dan here's some c# code of mine that might help.... InitializeComponent(); this._watcher.Created += new System.IO.FileSystemEventHandler(this._watcher_Created); this._watcher.Changed += new System.IO.FileSystemEventHandler(this._watcher_Changed); this._watcher.IncludeSubdirectories = true; this._watcher.EnableRaisingEvents = true; let me know if it helps
  15. I solved my problem. Thanks for all of your help. You are the man
  16. how can i attempt to connect a specific network connectionin code? i could try and contact the isp we use to see if they have any switches i can use in the command line with there software but they are dropping support for our version so i'd like to just avoid that whole mess if i can.
  17. uggg Object Reference not set to an instance of an object? objPlug.Initialize(objHost); // i changed that code to this if(objPlug != null) { objPlug.Initialize(objHost); Console.WriteLine(((jrn.IjrnPlug)objPlug).Name()); } Now i get the error Specified cast is not valid after skipping a few null values. Could the PlugServices.CreateInstance method be screwy??? (see above attachment for the file) here is the code minus the added code above public class jrnMain { [sTAThread] public static void Main() { jrn.IjrnHost objHost = new jrn.Host(); int index; //get a list of plugins jrn.PlugServices.availablePlug[] plugins = jrn.PlugServices.findPlug(Path.GetDirectoryName(Application.ExecutablePath), "jrn.IjrnPlug"); //loop through available plugins, creating instances and adding them to listbox for(index = 0; index <= plugins.Length - 1;index++) { jrn.IjrnPlug objPlug = null; objPlug = (jrn.IjrnPlug)PlugServices.CreateInstance(plugins[index]); objPlug.Initialize(objHost); Console.WriteLine(((jrn.IjrnPlug)objPlug).Name()); }//for } }//class i could of sworn i had a firmer grasp of programming than this....what's the deal? ugggggg brandon
  18. dude you are the man... thanksf or all the time you put into looking at that... i haven't tested it yet but it think it will work now. throughout changes i missed some little things that were tough to see About removing the parens from the Name property.... It's telling me i need them¿?¿ There are some other bugs in other projects in the solution.... could those keep it from checking sytax of this project correctly? The interface is declared properly... i'm gonna clean up these other bugs and see if that helps. THANKS AGAIN, udaman later brandon I'll
  19. look up UserControls... that should be what you want to do. brandon
  20. what about after presses a button to 'submit' or whatever they are doing.. have it run validation again just in case? eh..i tried.. i saw you had 0 replies brandon
  21. There are lots of details in a Date/Time users of your control will be weary about and they could probably screw it up... why not just make a small form of your own to set the properties at design time. Just a thought. Brandon
  22. i am trying to update a windows service i created automatically. I can not depend on them to update the app... We did think of a solution though. Have the app automatically dialup at night and update for us. Then there are no worries about id10t erros :) thanks for the help brandon
  23. Here are the files... Interfaces is compiled as it's own dll MTUer is compiled as it's own dll PluginServices, Main and Host are part of a console application. All files are compiled in the same dir Host.zip
  24. yes they implement the interface. Correction to my ealier post it is the obj.Initialize line that throws the exception Should i attach the whole project? (it's not very big). I have a feeling it's somethign stupid but i'm just stuck and i think my eyes are going to fall out. thanks, brandon
×
×
  • Create New...