|
Request.UserHostAddress;
Gets the remote clients address
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hello,
I have a form with several controls whose content is saved to an internal object when the control gets the Validated event.
The problem is that when my Save button is clicked on the ToolStrip , the control that currently has focus doesn't lose it, so it never gets the Validating /Validated events.
Using the good-old ToolBar from .NET 1.x, I could try to set the focus to the toolbar in my ButtonClick event handler, and if it failed, I knew the Validating event had prevented focus getting out of it.
But while the ToolStrip has an ItemClicked event, it seems it's only fired for a ToolStripDropDown , and not for a regular ToolStrip .
I tried catching the Click event, but I didn't get it either.
So, any ideas? I don't want to have to do it in the Click handler for every item.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Hi everyone,
I've found this code that can send SMTP commands via sockets (25).
The problem is when I send the command: "rcpt to:whatever@yahoo.com", I get a server response: "503 This mail server requires authentication ...".
Is there a way to create this authentication, to make this happen?
Thanks in advance,
Danny
|
|
|
|
|
Create the authentication???
You're misunderstanding what it wants. That particular server want's you to login using a username and password before you can do anything with it. If you don't have an account on the server, you're not going to be able to do anything with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 22:09 Thursday 23rd March, 2006
|
|
|
|
|
So you're saying that it can't be done?
So how are the SMTP based apps work?
|
|
|
|
|
DannyAdler wrote: So you're saying that it can't be done?
No! I'm saying that the server wants a username and password before you can use it!
DannyAdler wrote: So how are the SMTP based apps work?
I think you better read up on SMTP before going any further with that app. Also, you might want to read up on why that server is asking you to authenticate before you use it.
SMTP Reference[^]
RFC2821: Simple Mail Transfer Protocol (Replacing the older SMTP standards)[^]
EMail Spoofing[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to do raster operation, that is similar to SetROP2 in the GDI...
Kindly apoint me to perform this, to be able to achieve copypen and maskpen
|
|
|
|
|
Doesn't exist in GDI+. You could use pinvoke to make the GDI calls instead.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I would like to get access to the chat area of a commercial application so i can retrieve the text for analysis ... WITHOUT using the mouse.
Currently, i am accessing the text, successfully, by smulating mouse-clicks in the commercial application's chat area, and using SendInput (<ctrl>-c) to put the data in the clipboard, once every 30 seconds.
But that technique has two bad side effects ... it steals the cursor for a split second, and it uses the clipboard in a VERY non-standard way.
I am hoping that there is a way for me to get the data by going directly into the chat control of the target window. I have the handle to the window but i am not very knowledgeable about the structure of windows and child controls of a window, so i don't know how to approach the problem this way.
Please advise, or point me to an understandable explanation ... lol ... of how to do that. (I tried the MSDN libraries and i could not get a clue.)
I am also open to any alternative ideas.
Thank you very very much.
|
|
|
|
|
Ok, supposing you're trying to do this for a something legal, first you have to use Spy++ to find the text control in the window hierarchy. Then you could use EnumChildWindows as many times as required to get the Edit control (that's the way they are called in the Windows API ) handle, and send it a WM_GETTEXT message.
But since the other app probably isn't written in .NET, you're better off using the Win32 API.
If it's a regular text box coontrol, it's actually rather easy.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Thanks, Luis
You are right .. it was easy ... 2 statements ... after i spent 16 hours trying to get the compiler to accept my SendMessage statement ...
... but what the heck .. i learned a LOT about DLLs, SPY++, and overrides in the process
Thanks, again, for your response.
|
|
|
|
|
I'm glad I could help!
It feels nice when after a lot of hours you finally manage to do something and then think "next time it'll take me 5 minutes"
The good thing is that you learned a lot. Altough with .NET some may say that Win32 is becoming obsolete for everything but some low-level tasks, I've found many times that good knowledge of it can save you even in the managed world!
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
How to make Windows open specific files with a specific program???
Lets say i make a program which saves something to .fil -files, how to associate .fil files to my program ???
|
|
|
|
|
Look at the registry keys in HKEY_CLASSES_ROOT, sorry I don't have time at the moment to explain further, if I get the time tomorrow and you haven't sorted it I'll explain it more thoroughly.
Ed
|
|
|
|
|
If you open your registry using regedit, and select HKEY_CLASSES_ROOT, you will see an enormous list of, amongst others, file extensions. Like...
*
._sln
.txt
.rar and so on. Each of these registry keys has their default string value set to the name of another key in HKEY_CLASSES_ROOT, like .rar has its default value set to WinRAR .
If you go to the WinRAR key in HKEY_CLASSES_ROOT, it will have various properties to it. Its default value is set to the what the file is for - "WinRAR Archive" in this case. A sub key of the WinRAR key is shell which in turn has a sub key open . The default value of the open key is what you want to appear as the default menu item in the context menu that is shown when a user right-clicks on a file of this type in Windows Explorer. Inside this key is another sub key called command . The default value of this is where you can set the program you want to launch when someone opens the file. You can use "%1" to represent the file path - so if you wanted to load the file in notepad, you could set the default to
"notepad.exe" "%1"
So an example hierarchy for a new file type of extension .fil, if you wanted to launch it with say "MyApp" could be...
HKEY_CLASSES_ROOT
-> .fil
* (Default) = filfile
-> filfile
* (Default) = fil File
-> shell
-> open
* (Default) = Open this fil file with MyApp
-> command
* (Default) = "C:\Path To MyApp\MyApp.exe" "%1" (where '->' represents a key, and '*' represents a value)
Hope that helps (and makes sense)
Cheers,
Will H
|
|
|
|
|
I am not a big fan of messin around with the registry. I'm running XP so this is what i would try:
open any folder.
Under the Tools menu ... select Folder Options
Under Folder Options ... select File Types
I've never done it, but it looks like you can make a file association right there. Just press the NEW button, enter the file extension and press okay.
This will cause the new file extension to be displayed (and selected) along with all the others.
Next, press the CHANGE button next to the "Opens with" thingie, locate the program you wish to associate with that extension, and you are in business ... maybe, hopefully, possibly ... lol.
Good luck
|
|
|
|
|
Can a '03 queue contain objects of different types?
|
|
|
|
|
Is it possible with c#? I'm wanting to update registry keys from one windows service.
|
|
|
|
|
It is certainly possible to use the OpenRemoteBaseKey method of the RegistryKey class in the Microsoft.Win32 namespace to read the registry on another machine but I am not sure about updating. Both machines need to be running the Remote Registry service for this to work and must have remote administration enabled.
|
|
|
|
|
Yeah i got the remote viewing under control...
With remote editing, I can do it with VBscript easy:
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")<br />
objReg.SetStringValue HKEY_LOCAL_MACHINE,strPointerKey,strPointerEntry,strPointerValue<br />
objReg.CreateKey HKEY_LOCAL_MACHINE,strMyKey
surely .NET can do it. this is what i tried:
RegistryKey LM = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,WSID);<br />
RegistryKey inventoryKeys = LM.OpenSubKey("SOFTWARE\\CompanyName\\AppName");<br />
inventoryKeys.SetValue("ValueName","Value");
and the error message is:
Get REG values: System.UnauthorizedAccessException: Cannot write to the registry key.
at Microsoft.Win32.RegistryKey.ValidateState(Boolean needWrite)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at testReg.Class1.update() in c:\projects\testreg\class1.cs:line 48: 03/24/20
06 02:41:01 PM
-- modified at 14:58 Friday 24th March, 2006
|
|
|
|
|
How to use the string[] args from static void Main(string[] args) in an other void ???
|
|
|
|
|
|
For example, how to do this:
public static void Main(string[] args)
{
Application.Run(new Form1());
}
public void do_it()
{
int i;
for (i=0; i
|
|
|
|
|
Something like this mabey?
<code>string[] mainArgs;
public static void Main(string[] args)
{
mainArgs = args;
Application.Run(new Form1());
}
public void do_it()
{
int i;
for (i=0; i
textBox1.Text += mainArgs[i];
}</code>
|
|
|
|
|
static string[] mainArgs;
|
|
|
|