PDA

View Full Version : [VB.NET] Sending a PM through clraik using a link



Noxush
12-01-2012, 01:44 AM
Hey, I've been working on a program for the past few hours getting back into the groove and am wondering how I could open a user's default browser up, navigate to the messaging section of clraik, and add a default user to send to as "Noxush" and the title to be "So and so title."

I tried:


System.Diagnostics.Process.Start("[Only registered and activated users can see links]")

But, it just automatically sends a blank message to myself, so how would I get it to not send the request but just fill in the proper data?

j03
12-01-2012, 02:20 AM
Heading to bed, but if no one answers this by tomorrow afternoon then I'll help you out.

Edit: Actually yeah not sure.. never really worked with web browsers with .NET yet. Maybe Zachafer can help.

Vegeta
12-01-2012, 11:21 AM
Tagging for reminder Infamous Joe

Noxush
12-02-2012, 04:45 PM
Okay, I'll see if he pops up, if not I'll just send a quick PM.

Zachafer
12-02-2012, 06:13 PM
Hey, I've been working on a program for the past few hours getting back into the groove and am wondering how I could open a user's default browser up, navigate to the messaging section of clraik, and add a default user to send to as "Noxush" and the title to be "So and so title."

I tried:


System.Diagnostics.Process.Start("[Only registered and activated users can see links]")

But, it just automatically sends a blank message to myself, so how would I get it to not send the request but just fill in the proper data?

The link is incorrect. private.php would have to look for variables in the $_REQUEST array indexed "do", "recipients", "title", "message". As of 2/26/11 vBulletin only reads the "do" and "u" link variables.

Short answer: No you can't because vBulletin isn't setup like a mailto url ([Only registered and activated users can see links]).

If you want to do this in VBNet, you could use the WebBrowser control and then put a value into the "Title" textbox:
WebBrowser1.Document.GetElementById("title").SetAttribute("value", "Title Here")

If Infamous Joe wants to set up PM links like this, he should let me know.

Noxush
12-02-2012, 06:20 PM
Strange, I'm sure I saw someone do what I'm looking to do in Vb.Net a while back, I'll play around with your suggestion and see what I can do.

Zachafer
12-03-2012, 05:25 AM
Use your wrapper to send a PM using their clraik auth info? (clear it with joe first)

I'm sure you could try something like this in VBNet: [Only registered and activated users can see links]

Personally, I'd use the webbrowser control on a form... that thing is great.

Noxush
12-03-2012, 07:00 PM
Well, it opened a web browser and if they were logged in, it would go to the messaging page, put in a predefined title as well as contact, and allowed you to type a message to send. I was planning on using it as a "Contact Me" control.

EDIT: Oh, I had an epiphany and am testing with web browser controls, will reply later.

EDIT: Okay, I tried
WebBrowser1.Navigate("[Only registered and activated users can see links]")
WebBrowser1.Document.GetElementById("title").SetAttribute("value", "Program Help")

But it just throws me a "A first chance exception of type 'System.NullReferenceException' occurred in program.exe"

Zachafer
12-04-2012, 04:06 AM
First of all use WebBrowswer1.Navigate ("[Only registered and activated users can see links]") 'notice the changed URL

The null exception is occurring because once you call the Navigate method it doesn't pause execution. It will start loading the webpage and move on to the next code. So the Element with ID "title" does not (yet) exist in WebBrowser1.Document because it hasn't fully loaded when that line of code is ran.

Also, once you fix that, you will have to deal with logging in the user because a new WebBrowser has cleared cookies so the user will not be logged into clraik.

Noxush
12-04-2012, 07:07 PM
Oh crazy, maybe not such a good idea then and probably preferably an email may be a solution.