|
Thanks guys and sorry for posting the question in the wrong forum.
Cheers,
Chris
|
|
|
|
|
Hi~
Does the Windows XP connection firewall influence the traffic of ActiveSync?
Thanks~
|
|
|
|
|
If ActiveSync uses a TCP connection (found in corporate domain setups sometimes), yes. Otherwise, ActiveSync communicates through the USB or COM port, which is not controlled by the firewall.
If ActiveSync establishes an output TCP connection on behalf of your PocketPC, this shouldn't be a problem, either. The XP/2003 firewall allows all out-bound communication (though that will change a little with XP SP2, but the .NET Framework will be updated to accomodate that). If a service ActiveSync/PocketPC uses requests a user-defined port (like Active FTP), then there could be a problem since that port would most likely be blocked.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have to search a public Exchange folder in a C# application.
The public folder is visible only for one user, so I tried to add Credentials to the web request,
as it is described in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_searching_calendar_folders_webdav.asp ^:
<br />
MyCredentialCache = new System.Net.CredentialCache();<br />
MyCredentialCache.Add( new System.Uri("http://myFolderURI"),<br />
"NTLM",<br />
new System.Net.NetworkCredential(strUserName, strPassword, strDomain) );<br />
<br />
HttpWebRequest request = WebRequest.Create(myFolderURI);<br />
request.Credentials = MyCredentialCache;<br />
Exchange does not use the credentials. I may access the server, so the credentials are working. But Request.GetResponse() throws an exception "404 Not Found".
I checked the folder path in Outlook Web Access and found out that Exchange uses the login information I've entered only for the personal folders. For public folders my Windows authentication is used.
That means if Im logged on to Windows as user "A" and log on to Web Access as user "B", I see the personal folders of "B" and the public folders as if I were "A". The same applies to WebDAV. The credentials are only usedfor personal folders, but I cannot access the public folders that are visible to the user specified in the credentials.
So my application has to impersonate the user before accessing Exchange. This worked with CDO before, so I think it should work here, too.
<br />
myContext = myWindowsIdentity.Impersonate();<br />
WebRequest request = WebRequest.Create(strCalendarURI);<br />
Now WebRequest.Create throws an exception:
Exception in cofiguration handler (c:\windows\microsoft.net\framework\
v1.1.4322\Config\machine.config line 74)
machine.config contains a line proxy usesystemdefault="true" , telling WebRequest to read the LAN settings from the registry.
This must fail, because the CURRENT_USER hive of the impersonated user is not loaded.
To override this setting I created a configuration file "appname.exe.config" in the /bin/Debug folder, but it changed nothing. My configuration file is not being used - What's wrong?
How can I access the public folder as anotehr user via WebDAV?
...get impersonation and the config file to work?
...get Exchange to accept my request credentials instead of using Windows Authentication?
Thanks for every hint,
coco
|
|
|
|
|
Interesting problem. So when you redefine that in your app.config, it's not affecting anything? Since machine.config is the parent config section, any changes in your app.config will overwrite those changes (or add to/remove from/clear a collection, etc.).
The weird thing is that your Windows Identity is obtained through NTLM, for which your providing credentials. So when you use a web browser that supports NTLM (IE and Mozilla 1.7+) that identity is obtained through NTLM. The username is used to resolve the path, while the credentials are used to authenticate the user.
On thing you could try is to assign your own WebProxy to HttpWebRequest.Proxy . That should override any checking for registry settings. Also keep in mind that proxy discovery isn't in the registry and .NET won't parse that information. Would be nice if they added support for that in future versions of the Framework.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I want to debug my service, from Onstart() and in MSDN says we need to create another service (dummy) to call the main service, which I need to debug. How to call a service from another service??
Regards,
Satya
|
|
|
|
|
Actually, you can use any application and then use the ServiceController to reference and start your service. This allows you time to attach to a process (or start the process that starts your service) so that you can debug the service all the way from OnStart . If you don't do it this way, all you can do is attach to a running process (your service). By the time the process has started, OnStart has already been called. That's the reason for a separate process to start the service.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
This a doubt regarding a service written in C#. I have a service, (developed by some one else), and I modified the dll of the service. Now, the service starts and stops. Is it correct to do the modifications directly in the dll code. Mean to say, will it be any problem with registration kind of thing.
Please clarify my doubt.
Regards,
Satya
|
|
|
|
|
That greatly depends. If the checksum of the PE/COFF executable was no updated, the SCM (service control manager) or even the executable loader may find that the executable is invalid and won't load and execute it.
Make the modifications to the source if you have it, and reinstall the service. You could alternatively export the IL, change it, and reassemble it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How to convert a SVG Path string to .NET System.Drawing.Drawing2D.GraphicsPath ?
Who can tell me where can I find the source?
|
|
|
|
|
I don't know of any source for this myself, although it wouldn't be all that hard to write. If you find code for this, I'd be interested. I've been wanting to do this in a utility I'm writing, but haven't had time to work on it recently.
"A people that values its privileges above its principles soon loses both." -- Dwight D. Eisenhower
|
|
|
|
|
i am catching WM_ messages from my form and monitoring for WM_POWERBROADCAST messages which are dispatched when windows goes to sleep (thanks for the suggestions, Heath). but the problem is windows doesn't seem to make any distinction between STANDBY and HIBERNATE. when i place my computer in either standby or hibernate mode, both WM_POWERBROADCASTs are identical (ie, WPARAM values are equal, LPARAM are both 0). the SystemEvent class in .NET also has no distinction (either resume or suspend modes). i even analyzed ALL windows messages sent around the time the WM_POWERBROADCASTS are sent and tried to see if there are any unique windows messages sent just prior to or after the WM_POWERBROADCASTs to see if i could distinguish based on what other messages are sent. no luck there either.
am i basically just out of luck if i want to know whether my system is going into either standby or hibernate?
thanks!
|
|
|
|
|
This might get slightly ugly, however what you may need to do is look at the DEVICE_CAPABILITIES[^] returned from a IRP_MN_QUERY_CAPABILITIES[^] request. Specifically you will want to look at the SystemWake of the DEVICE_CAPABILITIES . Native code or at least MC++ would make things much easier on your end.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all,
I'm working on a method that parses through a html source file, and puts coldfusion comments around script tags. My problem is that the String.Input method is not working with the line read from my streamreader. When using the debugger, it hits the .Input(index, string) line, but it does actually change my string. I think this is because the line is in a stream, but I'm not sure. I know there is a programmatically simple workaround for this, but I haven't done it in so long that I can't remember. Suggestions please - my code is as follows:
private void outputnoscript(StreamReader reader, StreamWriter writer)
{
string line = "";
int opencounter = 0;
int closecounter = 0;
while(line!=null)
{
line = reader.ReadLine();
if (line!=null)
{
MatchCollection opencollection = Regex.Matches(line, "<script",RegexOptions.IgnoreCase);
for (int i = 0; i < opencollection.Count; i++)
{
Match openmatch = opencollection[i];
line.Insert(openmatch.Index + opencounter, "<!---");
opencounter += 5;
}
MatchCollection closecollection = Regex.Matches(line, "/script>", RegexOptions.IgnoreCase);
for (int i = 0; i < closecollection.Count; i++)
{
Match closematch = closecollection[i];
line.Insert(closematch.Index + 8 + closecounter, "--->");
closecounter += 4;
}
writer.WriteLine(line);
}
}
}
|
|
|
|
|
There is no Input member of the String class, but looking at your code I assume you mean Insert .
Strings are immutable. Performing an operation on a string does not change the string itself, but changes a copy of the string and returns it. So, either use something like string s = line.Insert(...) and write that using writer.WriteLine , or use a StringBuilder which is a mutable string.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is it just me or did Microsoft leave out a nice feature like allowing datagrid hyperlink columns for Windows Forms projects??? It's easy to do in ASP........
I've looked all over for someone who has succeeded to create a dataGrid.dataColumn hyperlink. I'm not using a database, just importing a firewall.txt file and sorting the IP's looking for duplicate access attempts. The idea is to simply click on the questionable IP and jump to arin.net for a quick look, however............ help......
|
|
|
|
|
Actually, MS left out more than hyperlinks in their datagrids.
What you can do, is derive a hyperlink column class from the DataGridTextBoxColumn and put a hyperlink control in it, override some events and voila, you have yourself a hyperlink column.
Here's an example on how to create a combobox column[^]. Just substitute it with a hyperlink control.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Ok, I'm sure there's an easy answer to this... I just can't figure this out? DUH..
I have a main application (form) that brings up a different form. What I want to do, is to detect ANY click while this new form is up. If the click is OUTSIDE the bounds of this form, I want to perform some action (such as closing the form). Any ideas?
|
|
|
|
|
If you're just wanting to monitor mouse messages for a short period of time (such as for a popup/menu), you can set the form's Capture property to true . This will redirect all mouse messages to your window. After the first click outside of your window, the mouse capture will be released and you won't get any more mouse messages from outside your form.
Other windows, including child windows on your form, will not recieve any mouse messages while your form has the mouse capture. If you need child windows to recieve mouse messages, release the capture when the mouse moves within your form's bounds.
Note that it is bad practice to capture the mouse for more than just a brief period/operation, as the mouse pointer is a shared system resource.
"A people that values its privileges above its principles soon loses both." -- Dwight D. Eisenhower
|
|
|
|
|
Well, a maybe simpler way could be to add an event handler for the Leave or Deactivate event.
The moment the user clicks outside your form it's losing focus and this event can be caught and handled.
But you have to remember that when you close the form yourself then these events are generated as well IIRC.
And that switching the window by using Alt-TAB for example also triggers this event, not just mouse clicks.
Regards,
mav
|
|
|
|
|
At least you have a decent user name
|
|
|
|
|
When my screensaver is running, I want to wake it up after a short period of time,
how can I do that?
Thanks..
|
|
|
|
|
If your application uses a message queue (i.e., a Windows Forms application), you can use SendKeys.Send("+") , otherwise use SendKeys.SendWait("+") (which you could also use in a Windows Forms application if you'd like). This sends a message for the SHIFT key, a safe key to wake-up the machine (and stop the screensaver, unless the particular screensaver doesn't simply quit with certain key strokes or mouse movement).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
After your Timer has run, call this.Close(); . Your question is rather open ended however you will simply need to end the execution.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Ok got a big problem. I have a brand new machine..i.e I rebuilt it and now I want to run a web project that references some C++ assemblies and some C# assemblies. I have done everything by the book but I keep getting the same error:
Parser Error Message: File or assembly name Core.Data.TM1, or one of its dependencies, was not found.
With the trace as follows:
=== Pre-bind state information ===
LOG: DisplayName = Core.Data.TM1
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/TMJTester
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Core.Data.TM1
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/tmjtester/51fb5434/c4dfe5c7/Core.Data.TM1.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/tmjtester/51fb5434/c4dfe5c7/Core.Data.TM1/Core.Data.TM1.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/TMJTester/bin/Core.Data.TM1.DLL.
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: Core.Data.TM1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4c3e63d723dc8458
___________________________________________________________
this seems like it is a circular reference issue...cannot be sure though. Any suggestions on how to figure out where the problem might be ?
Thanks
Sameer
|
|
|
|
|