IPC security problem (.NET remoting)
I have a problem for my IpcClient to connect to my IpcServer.
I get "Access denied" message.
It appears that the solution is to write this:
dict["authorizedGroup"] = "Everyone";
This works fine on my computer at work.
The problem is this is not working on my home computer. It is a Windows XP
french edition. The group "Everyone" does not exists.
Isn't it possible to remove security from the Ipc engine so it will allow
access to every group ? Tag: Windows groups Tag: 116146
Deployment problem
Hi
When I added a shortcut to the desktop folder it did work but the icon is
not the icon of the application is there a way to change that
T.Y.
Sam Tag: Windows groups Tag: 116142
Serialize List of objects as XML
Hello,
I have a list of objects that I want to serialize as XML and save it as
user setting. The objects are of type of the following class.
[Serializable]
public class SourceFolder
{
public SourceFolder(string path, bool controlled, bool
includesSub)
{
this.path = path;
this.controlled = controlled;
this.includesSub = includesSub;
}
public string Path
{
get
{
return path;
}
set
{
path = value;
}
}
public bool Controlled
{
get
{
return controlled;
}
set
{
controlled = value;
}
}
public bool IncludesSub
{
get
{
return includesSub;
}
set
{
includesSub = value;
}
}
private string path;
private bool controlled;
private bool includesSub;
}
In my settings object, I have a property of type List<SourceFolder>
that I assign my object list before saving. Unfortunately, the only
output in the file user.config is the following:
<setting name="SourceFolders" serializeAs="Xml">
<value />
</setting>
When I add the attribute
SettingsSerializeAs(SettingsSerializeAs.Binary) to the settings
property, it works, but the list is serialized binary what I do not
want.
Visual Studio 2005 help states that .NET framework is able to serialize
lists of any object to XML stream. What am I doing wrong that it does
not work for me? When I use List<string> instead of List<SourceFolder>,
it works fine, but not with my class.
Regards, Jens Tag: Windows groups Tag: 116141
Binding HttpListener to a free port
Hi,
When providing the HttpListener with a list of 'prefixes' to respond to
there doesn't appear to be an option for binding to an arbitrary freely
available port, and if there is then there doesn't seem to be a
mechanism for discovering that port by the calling code.
I'm happy to be proven wrong here but given this situation, the obvious
approach now would be to programatically query the OS for a list of
used and/or available ports, and to pick one of the available ones.
This may introduce the problem of a port being allocated in the time
between querying the OS and binding to the port, but I can handle that
exception and keep trying until a successful bind occurs (hopefully!).
Am I going about this the right way? Is there an alternative to
HttpListener? I suppose I could revert to using HttpListener and
perhaps re-using the provided HTTP classes for handling the HTTP
protocol?
Thanks in advance for any help,
Colin Green Tag: Windows groups Tag: 116139
TransparencyKey vb.net 2005 on form works only on developing machine.
Hi all,
Setting the transparency key on vb.net 2005 form (I randomly chose the
color yellow), works great on my machine, meaning i set the form's
background color to yellow as well, and it becomes transperent.
Deploying my app on 3 other machines, i fould out the yellow background
shows on their app.
I was reading about the the color quality bug (16,24,32 bit), and
thought of it has a problem. But checking all machines, all including
mine were set to 32 bit. So why does it not work, and is there a
workaround.
Thanks in advance,
Eli Tag: Windows groups Tag: 116138
ConfigrationManager Problem
Hi, I am trying to call the new ConfigurationManager class but all I get is
"does not exist in the current context".
I can substitute with System.Configuration.ConfigurationSettings.AppSettings
and all seems to be fine.
Any ideas? here is the actual code
protected string ConnectionString {
get {
if (ConfigurationManager.ConnectionStrings["Timer"] == null)
throw (new NullReferenceException("Invalid Connection"));
string connectionString =
ConfigurationManager.ConnectionStrings["Timer"].ConnectionString;
if (String.IsNullOrEmpty(connectionString))
throw (new NullReferenceException("Invalid Connection attempt")
else
return (connectionString);
}
}
Thanks
Steve Tag: Windows groups Tag: 116136
XSD.EXE vs System.Xml.Serialization problems
I'm using the System.Xml.Schema and System.Xml.Serialization objects to
generate XSD dynamically and then the CSharpCodeProvider to generate
classes. When using xsd.exe with the "/dataset" switch it generates just
what I want. When I do it through the framework I get the equivalent of
xsd.exe with the "/classes" switch.
I don't seem to be able to find where I can programatically set the option
for class vs dataset. This must be possible, this is surely how xsd.exe is
doing its work. What am I missing? Tag: Windows groups Tag: 116135
Connection is busy with results for another hstmt
Hello:
I'm using a connection in a web page to connect to SQL Server throught an
ODBC driver, but from time to time and witthout using DataReaders (I return
data in Datatables) I get an error like this:
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for
another hstmt
Anyone can help me?
The connection is unique for each page I call.
Thanks Tag: Windows groups Tag: 116129
TextRenderer problem
Hi,
I'm creating a control that overrides ListView and so I'm working on
redrawing everything myself with some changes here and there...
But I'm having a problem with drawing the text inside the rectangle on
LargeIcon mode... I thought I'd finally discovered the solution with
TextRenderer but this still doesn't give the correct results.
Here's the code I'm trying to use (item is a ListViewItem)
Rectangle text_rect = item.GetBounds(ItemBoundsPortion.Label);
TextFormatFlags formatFlags = TextFormatFlags.WordBreak |
TextFormatFlags.HorizontalCenter | TextFormatFlags.Top |
TextFormatFlags.EndEllipsis;
if (item.Text != null && item.Text.Length > 0)
TextRenderer.DrawText(dc, item.Text, item.Font, text_rect,
item.ForeColor, item.BackColor, formatFlags);
The problem is that its still not exactly what the original ListView
displays... ie
I'm displaying:
___________
| some |
| really long |
original ListView displays:
___________
| some really |
| long text |
Surely it should fit inside the bounding box if its using the GDI draw
method and I'm using the bounding box thats returned to me from the
ListViewItem itself? Any ideas?
thanks
Kris Wragg Tag: Windows groups Tag: 116124
Getting a file's ContentType
I would like to be able to get the ContentType of a file programmatically
(for example, I want *.txt files to return "text/plain"). I could not find a
way to do this using VB.NET's classes, but I am also somewhat new to using
the System.IO namespace for anything other than text files and the pure
basics, so I could very well have missed it. Any help would be appreciated.
Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: Windows groups Tag: 116115
Customization In Web Application
All,
Using VS 2005, C#.NET, SQL Server 2005, W2K3.
We are developing a web application that would be shared by numerous
customers for information management. Some of those customers want
variations on the usual form layout.
For example, we have a form where the user can enter their dependents
information (parents, siblings, spouse, kids, etc.), but we know one of our
customers wants to include additional information on that form that none of
the other customers would use (company specific insurance coverage).
Based on our experience with our C/S version of the product, we can expect
to see many more requests like this.
There are 3 ways to do this that I see.
1. Create a separate web application for that customer and host it on a
different web server.
2. Add the custom fields to the single web application but hide the extras
based on the customer using it.
3. Allow the customer to add the fields themselves and store them for just
that customer.
Pros and cons that I see.
1. Quick to implement, but costly in new infrastructure, and would end up
difficult to maintain.
2. Still relatively quick to develop, and uses existing infrastructure, but
would create complex forms.
3. Difficult to develop, but would use existing infrastructure and wouldn't
need extra maintenance.
Personally, I'd like to use 3. That is... Design the application so that
each form includes standard fields, but a customer can add new labels,
textboxes, drop-down combos, lists, etc., themselves and doing so doesn't
require us to change any code or the database schema.
While this would be a no-brainer in an C/S application, it gets a little
more difficult in a web app since the only client they use is a browser.
Any thoughts? Tag: Windows groups Tag: 116111
Re: Graphics.PageUnit problem... (spelling checked.. ;-(
I have to do some WYSIWIG rendering.
Because I need to know exactly where is what and have to have the same
output on both the screen and the printer I decided to change my Page unit
to Inches.
As I was testing my first thought was to draw red outline of some relevant
rectangle.
And here I had my 1st encouter with those infamous Windows strangeness....
Even though I had set my line width to 0, GDI+ draw 1 inch thick
rectangles...
What's that?
How could I fix that?
Below is a code sample showing the problem,
just try it: big rectangle:
==========================
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.PageUnit = GraphicsUnit.Inch;
using (Pen pen = new Pen(Color.Red, 0))
{
pen.Width = 0;
e.Graphics.DrawRectangle(Pens.Red, 0, 0, 8.5f, 11);
e.Graphics.DrawRectangle(Pens.Red, 1.5f, 1.25f, 5.5f, 8.5f);
}
} Tag: Windows groups Tag: 116107
Graphics.PageUnit problem...
I have to do some WYSIWIG rendering.
Bacause I need exactly where is what and have the same output on the printer
I decided to change my Page unit to Inch.
As I was testing my first though was to draw read outline of some relevant
rectangle.
And here I had my 1st encouter with those infamouse Windows strangeness....
Even though I had set my line width to 0, GDI draw me 1 inch thick rectangle
borders...
What's that?
How could I fix that?
Below is a code sample:
=======================
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.PageUnit = GraphicsUnit.Inch;
using (Pen pen = new Pen(Color.Red, 0))
{
pen.Width = 0;
e.Graphics.DrawRectangle(Pens.Red, 0, 0, 8.5f, 11);
e.Graphics.DrawRectangle(Pens.Red, 1.5f, 1.25f, 5.5f, 8.5f);
}
} Tag: Windows groups Tag: 116106
How install cab file on background based in mobile device?
Dear experts,
I try to install a cab file by code, I use P/Invoke can do it.But its a
problem , if the programe has installed in Pcoket PC,there is a prompt saying
"An older version of the application already exists. Do you want to
reinstall?". Is there some method to let this messagebox dont show?This is
say that the setup screen does not display.
My os is windows mobile 5.0
Thanks and Regards,
collysun Tag: Windows groups Tag: 116105
Rewrite ...
This post is mostly for discussion. Why rewrite in .NET? Just a general
discussion not related to any specific details. I was just looking to see
what reasons developers are looking to, to help decide whether they should
rewrite their app in .NET.
What are the trends being observed of Microsoft when it comes to .Net?
How much longer will COM objects live on?
How stable is the Framework?
If the goal is to maintain a software package for the next 10 years, would
that make a differnce on the decision?
What if a rewrite would take approximately 2 years, would that affect when
you decided to do a rewrite?
Are their any security benefits?
I am looking for opinions, but also links to facts that can help support
your case. I'm hoping this can become a good discussion.
Thanks Tag: Windows groups Tag: 116103
How install cab file on background based in mobile device
Dear experts,
How install cab file on background based in mobile device? This is say that
Setup screen does not display.
Os is windows mobile 5.0
Thanks and Regards,
collysun Tag: Windows groups Tag: 116102
??? MethodInfo Props are Wrong (or Docs are Wrong) ???
Hi everyone,
I hope you can comment on this -- I'm pretty darned sure that either
some of the MethodInfo properties are wrong or the Microsoft
documentation is wrong.
Please have a look at the program below. It attempts to print out the
accessibility (i.e., "visibility") of each method in the class. I've
included the program along with its output.
The Microsoft documentation for MethodInfo tells us that the IsAssembly
property "Gets a value indicating whether this method can be called by
other classes in the same assembly." Okay, great. Public methods can
certainly be called from other classes in the same assembly, right? Not
according to the program below. The output indicates a public method
cannot be called from other classes within its assembly because the
IsAssembly property is false.
There are other inconsistencies in the output as well - for example, an
internal method cannot be called from a subclass in the same assembly.
Read the Microsoft documentation very carefully. You'll see that the
IsPrivate and IsPublic properties refer to the accessibility of the
member itself. For example, m.IsPublic indicates whether or not m is
public.
In contrast, IsFamily, IsAssembly, IsFamilyAndAssembly and
IsFamilyOrAssembly indicate whether the method in question can be
called from a method with that accessibility. For example, m.IsAssembly
indicates whether m can "be called by other classes in the same
assembly". This is distinctly different from saying that m has internal
accessibility. So, certainly any public method can "be called by other
classes in the same assembly", right? Not according to the output
below.
It's very inconsistent and the property values are inconsistent with
what the documentation says they should be.
I guess you can look at this as either the MethodInfo properties are
wrong or the Microsoft documentation is wrong. I guess I'm just a
stickler.
---------------------
using System;
using System.Reflection;
class Program {
private static void Main(string[] args) {
Type t = typeof(Program);
MemberInfo[] members = t.GetMembers(BindingFlags.Public |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.DeclaredOnly);
foreach (MemberInfo mi in members) {
Console.WriteLine(mi);
MethodInfo methodInfo = mi as MethodInfo;
if (methodInfo != null) {
Console.WriteLine(" Private: " + methodInfo.IsPrivate);
Console.WriteLine(" Public: " + methodInfo.IsPublic);
Console.WriteLine(" Assm: " + methodInfo.IsAssembly);
Console.WriteLine(" Fam: " + methodInfo.IsFamily);
Console.WriteLine(" Fam & Assm: " +
methodInfo.IsFamilyAndAssembly);
Console.WriteLine(" Fam | Assm: " +
methodInfo.IsFamilyOrAssembly);
}
Console.WriteLine();
}
} // main()
protected void ProtMethod() {}
internal void InternalMethod() {}
public void PublicMethod() {}
protected internal void ProtInternalMethod() {}
} // Program()
------ OUTPUT ----------
Void ProtMethod()
Private: False
Public: False
Assm: False
Fam: True
Fam & Assm: False
Fam | Assm: False
Void InternalMethod()
Private: False
Public: False
Assm: True
Fam: False
Fam & Assm: False
Fam | Assm: False
Void PublicMethod()
Private: False
Public: True
Assm: False
Fam: False
Fam & Assm: False
Fam | Assm: False
Void ProtInternalMethod()
Private: False
Public: False
Assm: False
Fam: False
Fam & Assm: False
Fam | Assm: True
Void .ctor() Tag: Windows groups Tag: 116099
Outlook Mail Drag & DRop
It's so simple to get an attachment from Outlook by drag & drop. Why
shouldn't be the case with a complete mail.
Has some one an idea what's in the Drag & Drop Data behalve a unuseful
filename, and some headers that interest nobody.
How can we retrieve the message file of the dropped item ? As items are
converted into .MSG files when dropping messages into the explorer.
Thanks
Laurent Tag: Windows groups Tag: 116098
Overridden GetProperties() of ExpandableObjectConverter not called!
In a custom ExpandableObjectConverter I have overridden GetPropertiesSupported
(always returns true) and GetProperties. The class to which this
TypeConverter is applied has only public properties and it should be accessed
via a PropertyGrid.
However, GetProperties is never called!
By overriding some more methods and setting breakpoints inside those overrides
I have found out that all overrides are being called correctly, except for
the one GetProperties. Trying to catch any first chance exceptions doesn't
come up with any results, since there aren't any exceptions thrown.
Thus the desired expanding and minimizing of the object's properties isn't
possible.
Any ideas how to make GetProperties being called?
Thanks Tag: Windows groups Tag: 116096
Script for building/debugging services
I have found services debugging to be a big pain. One reason is because
the play button in VS is worthless for this kind of application.
So I wrote this scripts that will execute for an app whose name ends on
Service, it will lookup the debug directory, Stop the service copy the
executables and restart the service. Now there is a lot of room for
improvement. But I thought I'd share and maybe someone out there will
improve on it. It also executes when the app has just been built, so
you only need to attach to the process instead of hitting the arrow.
Or maybe I am missing something; and there is no need for this at all.
To make this work you need to open the Macro editor on the menu it is:
"Tools/Macros/Macro IDE ...". There you can edit the MyMacros template.
Public Module EnvironmentEvents
#Region "Automatically generated code, do not modify"
Private Sub BuildEvents_OnBuildDone(ByVal Scope As
EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles
BuildEvents.OnBuildDone
Debug.main()
End Sub
End Module
Public Module Debug
Private fullexepath As String = "C:\Program Files\My company\My
app"
Sub main()
Dim _project As EnvDTE.Project
_project = DTE.Solution.Projects.Item(1)
If
_project.Properties.Item("Title").Value.ToString.EndsWith("Service")
Then
Dim _process As Diagnostics.Process
_process =
Diagnostics.Process.Start("C:\Windows\system32\cmd.exe", "/c ""net stop
TNAEventService""")
_process.WaitForExit()
Dim OutputPath As String
OutputPath =
_project.Properties.Item("LocalPath").Value.ToString()
OutputPath +=
_project.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value
For Each OutputPath In Directory.GetFiles(OutputPath)
Dim fi As FileInfo = New FileInfo(OutputPath)
Dim vFileStream As FileStream
If File.Exists(fullexepath + "\" + fi.Name) Then
If Not Directory.Exists(fullexepath + "\old") Then
Directory.CreateDirectory(fullexepath + "\old")
End If
File.Move(fullexepath + "\" + fi.Name, fullexepath
+ "\old\" + fi.Name + "." + Now.ToString("yyyymmdd hhmm"))
End If
File.Copy(OutputPath, fullexepath + "\" + fi.Name)
Next
_process =
Diagnostics.Process.Start("C:\Windows\system32\cmd.exe", "/c ""net
start TNAEventService""")
_process.WaitForExit()
End If
End Sub
End Module Tag: Windows groups Tag: 116093
Effort/Time in migrating 1.1 to 2.0
Hi, wanted to know what people have experienced in terms of effort+time in
migrating your apps to 2.0 from 1.1?
Are there any case studies on msdn? I couldn't find any..
how well did it go with you all? days? weeks? months?
we have a mid sized external app using mcms, a small asp.net app for internal
use, a small console app, and a webservice..
we will migrate if it's a relatively small investment.. otherwise, we will
stick with 1.1 for at least a year more as we have lots of integration projects
coming up.. my idea is that upgrading now will be cheaper than doing the
upgrade AFTER making the apps larger.. but that's me..
thank you Tag: Windows groups Tag: 116086
windows media player
Hi,
How can I (remotly) control my windows media player.
like the logitech software.
like:
windows media player is playing a list of songs.
run my exe, and the next song is player.
I can't find some information about it.
thank you Tag: Windows groups Tag: 116085
Aborting startup of a Windows Service
I'm in the process of writing a Windows service, however I've encountered an
odd problem.
In my service class in the overridden OnStart method I want to abort the
startup of the service should some error be encountered.
I've tried throwing an exception and tried calling the default OnStop
method, but the service controller still reports the status as Running.
What is the correct way to abort or exit the startup of a service ?
Thanks in advance
Steve Tag: Windows groups Tag: 116074
.NET 2.0 MMC Config problems
I have 2 windows 2000 Server and 1 windows 2003 Server machines used for IIS
apps. All 3 have the .NET 2.0 Framework.
On my local workstation I have a ".NET Framework 2.0 Configuration" MMC
snap-in.
One none of the above servers (and Im logged in as a member of the
Administrators group) does that snap-in show or is there something similar in
the Administration tools - although there is a 1.1 utility.
I saw a posting to remove a registry key and then run aspnet_iis, but that
didnt make a difference.
And I need to access the GAC through the utility.
Thanks, Mark Tag: Windows groups Tag: 116072
Create System.Console from a winforms app
Is there a way to create a System.Console from code. I periodically have a
WinForms app that needs to open a console window for progress tracking.
Thanks,
Mike Ober. Tag: Windows groups Tag: 116070
problem with COM Object Wrapper or with Remoting... which one?
Hi,
I have a web project in VS 2005 and I'm using a wrapper to work with a COM
object. this object must work in a remoting environment. So we've done a
simple console app to give us the access to the remote object.
In our test web app, everything works fine... if we copy paste all the code
from the test app to the real app so we can have exactly the same thing in
each one, the real application raise an exception on the first call I do
after the "new MyObject()" line. My first guess would be that the problem
comes from the remoting, but I use exactly the same config file than the
test app.
The wrapper was in Framework 1.1, so I converted it to 2.0, I don't know if
it can change something, but for now, it does not work.
Does someone have an idea of what it would be? I mean, even with the same
code and the same config file. Is there a setting or something like it that
could cause the problem?
Thanks
ThunderMusic Tag: Windows groups Tag: 116068
GAC - What's using my assembly
How can I determine what is consuming a particular assembly that's in
the GAC.
(There's an assembly of ours that's not letting me delete it from the
GAC. It's COM exposed and so could be used be either COM or .NET) Tag: Windows groups Tag: 116066
DateTime Ticks/Milliseconds Question (possibly Thread.Sleep () related - ?)
Hi,
Slightly dim question, possibly. I dunno. When i run the following c#:
for (int i = 0; i < 100; i++)
{
System.Diagnostics.Debug.WriteLine
(DateTime.Now.Millisecond.ToString ());
System.Threading.Thread.Sleep (1);
}
I would expect the output to increment by at least 1 every line (since
I am asking my thread to sleep for 1 millisecond).
The output generated, however, looks like this:
627
409
409
409
424
424
440
440
440
456
456
456
456
(etc)
surely this is impossible?
I also noticed a similar thing when using Ticks instead of Milliseconds
Is there something im missing? I thought maybe it was something i hadnt
encountered before to do with thread scheduling (ie: none others to be
scheduled, so its not sleeping), but if i change the interval to 100ms
there is a visible (and seemigly regular) pause, and the output number
increments by slightly more than 100 each time round.
If anyone can shed some light on this i would be grateful - I'm now
wondering if its something to do with the clock speed of my PC...?
Thanks,
Chris Tag: Windows groups Tag: 116061
capture application output
Hi,
How can I capture the text output of a console app?
For example, I would like to capture the outpur of "qwinsta"
Thanks. Tag: Windows groups Tag: 116059
How to kill a terminal server session (VB.NET)
Hi,
Is there a way to kill a Terminal Server session from vb.net?
I have to constantlly access our servers to reset ureser that get hung. I
would like to have a web interfave that I can access via my PDA/Phone. It
dose not have to be a wab page that does this. I could write to a queque
that is read by a windows servrice on the TS server and then reset the user.
Thanks.
George. Tag: Windows groups Tag: 116058
PadLeft ? What difference it make if the argument to this function carries an integer whose value is less than the length of the string object
Hi,
I came across a doubt on the String.PadLeft Method.The doubt is this --
What's difference it make if the argument to this function carries an
integer whose value is less than the length of the string object
For example in the sample code below(VB.NET) I could not see any difference
Dim str As String
str = "BBQ and Slaw"
Console.WriteLine(str.PadLeft(5)) ' Displays "BBQ and Slaw".
Console.WriteLine(str.PadLeft(15)) ' Displays " BBQ and Slaw".
I could not notice any difference with the output of str.PadLeft(5) and
the original str string.Both carries the same message "BBQ and Slaw"
Can any one tell me what is the use of this particular function if the
padleft paramater is less than the length of the string.
Reny Tag: Windows groups Tag: 116056
Maintaining Sessions HttpWebRequest
I'm having problems to maintain a session with a remote server using
HttpWebRequest in .NET v2
I read a page using, which gives me data and holds it in a session.
(classic ASP)
The second request I need to use data from that session with the new
data I provide from ASP.NET.
My problem is that both requests appear to have a seperate Session;
asp.net <- classic asp session-related data (session 1)
asp.net -> classic asp session-related data + asp.net data (session 2
opened)
Instead of sharing one;
asp.net <- asp session-related data (session 1)
asp.net -> asp session-related data + asp.net data (session 1)
Is there a way to force the same session being used by the ASP.NET
page?
The code I currently am using, but isn't hooking back to the first
session:
public class Remote
{
public static string GetRemoteHTML(string ContentURL)
{
try
{
// Get HTML data
HttpWebRequest wreq =
(HttpWebRequest)HttpWebRequest.Create(ContentURL);
wreq.KeepAlive = true;
if (HttpContext.Current.Cache["ASPSESSION"] != null)
{
//string Cache =
HttpContext.Current.Cache["ASPSESSION"].ToString();
//string CName = Cache.Substring(0,
Cache.IndexOf("="));
//string CValue =
Cache.Substring(Cache.IndexOf("=") + 1, Cache.IndexOf(";") -
Cache.IndexOf("=") - 1);
//CookieContainer Cookies = new CookieContainer();
//Cookie Cookie = new Cookie(CName, CValue);
//Cookie.Path = "/";
//Cookie.Domain = ContentURL.Substring(0,
ContentURL.IndexOf("/",8));
//Cookies.Add(Cookie);
//wreq.CookieContainer = Cookies;
wreq.Headers.Add("Set-Cookie",
HttpContext.Current.Cache["ASPSESSION"].ToString());
}
HttpWebResponse wres =
(HttpWebResponse)wreq.GetResponse();
System.Web.HttpContext.Current.Cache.Insert("ASPSESSION",
wres.Headers["Set-Cookie"].ToString());
Stream streamResponse = wres.GetResponseStream();
StreamReader streamRead = new
StreamReader(streamResponse);
string responseString = streamRead.ReadToEnd();
streamResponse.Close();
streamRead.Close();
return responseString;
}
catch(Exception e)
{
throw e;
}
}
}
Is there something I'm overlooking?
Tim Tag: Windows groups Tag: 116054
QUERY: Adding more JS/DOM attributes to DataGrids
I know that JavaScript lets us add:
ondragenter, ondragover, ondragleave, ondrop
events to normal HTML table td tags. This lets us do highlighting of
table cells/rows, and capture drag & drop events. So to handle
ondrop we can use JavaScript:
this.OnDrop = function(obj) {
obj.parentElement.style.backgroundColor = "white";
var strData = window.event.dataTransfer.getData("text");
this.InsertRow(obj.parentElement.rowIndex, strData);
window.event.cancelBubble = true;
}
The obj is the object that was dropped onto. So obj.parentElement is
the tr element, etc. Does all tr elements implicitly have a rowIndex
member which contains the row number of the table?
What am wondering is how can one add the ondrop="" attribute to a
table which was generated from a DataGrid? If it is not possible
adding JavaScript/DOM attributes to DataGrid's generated tables, then
is there any way to capture these window.events and knowing exactly
which DataGrid table row/cell it was dragged onto?
I was told to look for "DataGrid Overviews" at 4guysfromrolla.com but
could not find anything about it. Not even google.com could help. Is
there no drag and dropping support for ASP.NET datasource tables? Tag: Windows groups Tag: 116053
Managed Component on IIS
Hi,
What is exactly a Managed component on IIS? I don't really know what this
IIS has to do with the Managed Components. Do you always need IIS for
Managed components? Are there other ways? Won't it be bad for performance
using IIS?
Thanks for any help our hints,
Pieter Tag: Windows groups Tag: 116052
Regular epressions with .net forward slash "/" character
Afternoon all,
Can somone help with this regular expression problem VB sample below
Dim RegexObj As Regex = New Regex("")
RegexObj.IsMatch( "<start field=fred col=2 />", "\x2f" )
Returns false with no match.
This is a simplified example trying to end my capture onthe "/>" but the
forward slash seems not be working.
Thanks Tag: Windows groups Tag: 116048
RadioButtonList .NET 2.0 Breaking Change
Can anyone shed any light on this issue.
We were generating HTML outside of a HttpContext in 1.0 and 1.1 by
building a control structure the calling RenderControl on the parent.
There has been a change to RadioButtonList Render method that causes a
null reference exception when Render is run without a HttpContext.
if (!base.DesignMode && !this.Context.Request.Browser.Tables)
This isn't listed in the breaking changes and I have never read that
you can't render controls without a Context.
Anyone know a work around for this? Is it a bug or by design? Tag: Windows groups Tag: 116046
web pages help
Hi,
I'm a developing a web application. One of it's requirements is that if the
users try to downlaod the web apges, they shouldn't get the relevnt css files
of the web page.. how can I acheive this?
any good sites????. Tag: Windows groups Tag: 116045
web pages help
Hi,
I'm a developing a web application. One of it's requirements is that if the
users try to downlaod the web apges, they shouldn't get the relevnt css files
of the web page.. how can I acheive this?
any good sites????. Tag: Windows groups Tag: 116044
tool window & shortcut keys
In my application I have some tool window.
some of these tool window do accept key input.
yet I would like key shortcut (CTRL+S, F2, etc...) to be handled by the main
menus of my main window.
how could I achieve somethink like that? Tag: Windows groups Tag: 116040
ToolTips and DataGridView
Hi guys,
I am using an unbound DataGridView.
I am using the built-in ToolTip that MS provides in VS2005 for the DGV
control.
I set the ToolTipText property of the DataGridViewColumn to some text.
I set the ShowCellToolTips to true in the DataGridView control.
Everything works fine at runtime.
I get my tool tip when the mouse hovers over the column header.
Now I want to set some of the properties for the built-in ToolTip.
Properties like InitialDelay , BackColor etc...
Does anyone know how to do that?
Thanks in advance....
Roger
--
Roger Tag: Windows groups Tag: 116035
SmtpMail.Send problem (bad)
I have an asp.net (1.1) that "as" sending emails okay. Lately it is trowing
the following exception:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. ---> System.UnauthorizedAccessException: Access
is denied. --- End of inner exception stack trace --- at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) at System.RuntimeType.InvokeMember(String name,
BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at
System.Web.Mail.SmtpMail.Send(MailMessage message) at
Que.temp.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\dev\queue\temp.aspx.cs:line 43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We are stumped.
2.0 apps on the same box work ok (Send()).
1.1 apps on another box work ok(Send()).
1.1 windows apps work ok(Send())
I've checked everywhere., but to no avail.
Anyone here have any ideas? Tag: Windows groups Tag: 116028
Check for Common character sequence ( I will pay)?
Hi,
Anyone know how I can do this?
I will pay anyone via PayPal who can do this for me. Let me know?
Write a function in C# that takes in an array of ASCII strings and finds all
common character sequences. A common character sequence is defined as 3 or
more adjacent characters that appear in more than one string in the array.
Use the following function signature for your response:
//C#
class FoundString {
public int cOccurrences; //count of times this substring
//occurred in the value array
public string szSubstring; //substring that was found
}
FoundString[] countSubstrings(string[] rgszValues);
Ex. input of ("will-01", "a_williams", "will_01_iam") would return
"wil" (cOccurrences = 3)
"will" (cOccurrences = 3)
"ill" (cOccurrences = 3)
"iam" (cOccurrences = 2)
Provide coded unit tests cases that exercise your solution.
For extra credit:
1a. Order the results in descending order based on the number of input
values each sequence matched.
1b. Prune the results by removing all results that are a substring of
another result that matched the same number of input values. In the above
example "wil" and "ill" would both be discarded because they are both a
substring of "will" and all 3 values match 3 input strings Tag: Windows groups Tag: 116019
Capture keytrokes before AxWebBrowser
Hi,
Is there an elegant way to capture/preview keystrokes in a Windows.Forms
application that has an AxWebBrowser control which is focused? The browser
seems to swallow anything while it has focus.
I also have a (related?) problem with back and forward buttons on the mouse.
They work just fine in a stand alone browser but not in my embedded
AxWebBrowser control.
Regards, Martin. Tag: Windows groups Tag: 116018
C Api Access
Ok, I have a app that has a C API, the API is very poorly documented and I am
trying to figure out how to expose the API so I can see what is there.
Suggestions?
--
D @ premierdata Tag: Windows groups Tag: 116017
Microsoft .NET Framework Primer for the Visual Basic Developer
I find it mildly amusing this following paragraph from a tutorial MS
wrote on an introduction to VB.Net for VB6 developers. It's written in
such a manner as to sound as the VS does something for you
(auto-generates) that previous versions did not. As if you had to write
the Form class by hand in VB6, lol.
"Although the designer is very similar at first glance, many
enhancements make Windows
Forms development easier while giving you more power and flexibility.
One of the most significant changes from Visual Basic 6 is that all
controls and other UI components are actually classes in the Framework
Class Library. When you drag a TextBox onto a form, Visual Studio 2005
auto-generates a field to hold a reference to a TextBox object and
writes the code for instantiating a TextBox object when the form is
initialized. The visual designer also writes the
code for setting the properties of the control. If you change the
BackColor property of the Text-
Box in the Properties window, Visual Studio 2005 generates a line of
Visual Basic code that
sets the BackColor. Figure 1-9 shows some of the auto-generated code
for the login form
shown in Figure 1-8." Tag: Windows groups Tag: 116013
VS2005 IDE
Does anyone else have problems with the following (not sure if it's my
settings):
* When using Ctrl + Tab to switch between open documents, the document
switches, but loses focus, and I have to either click on the document, or Alt
+ Tab to regain focus?
* Sometimes, docked windows do not auto-hide although they're not pinned
(and set to auto-hide)
Thanks,
A Tag: Windows groups Tag: 116011
WebRequest: only get info about file, not download the file?
Hello Group,
i want to get the file size of some files located on a webserver,
therefore i create a WebRequest with the URI of the file and then a
WebResponse on the WebRequest to get the ContentLength:
WebRequest webRequest = HttpWebRequest.Create(fileUri);
webRequest.Method = "HEAD"; //??????? (*)
WebResponse webResponse = webRequest.GetResponse();
fileSizeBytes = (ulong)webResponse.ContentLength;
(*) Does this setting make the WebRequest only send the info and not the
complete file?
I ask because i don't want to download large files completely only to
get the filename.
Thank you very much in advance,
Roland Tag: Windows groups Tag: 116009
Outlook Add In is not shown for 1 user...
Hi,
I developped some time ago an Outlook Add In (VB.NET 2005) that worked fine
during several months with all the users.
Suddenly, 2 weeks ago it stopped working for one of the users. The
administrator desinstalled it and installed it again, but that didn't work.
i did the same, desinstalled it, rebooted, removed everything I could find
about it in the registry of file system (nothing in both cases), reinstalled
it, but still not working... It works for every user on that pc, but not
forthis specific user...
I added a MessageBox at the beginning of the "Private Sub
ThisApplication_Startup(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Startup"-startup to be sure if it started or not, but the
MessageBox is never shown...
Does anybody has any idea why this happens?
and how to find a solution for this? Is there somehow a way to see which Add
Ins are available for who?
Thanks a lot in advance,
Pieter Tag: Windows groups Tag: 116007
Assembly.LoadFrom() ... multiple component versions
You can load multiple versions of the same assembly into the same process
using LoadFrom().
However, (straight from Don Box's book) this can cause problems (for
example, multiple copies of static fields... one for each instance of a
loaded type).
I remember in the book he mentioned that you could set attributes to prevent
loading of different versions of the same assembly, but I can't remember what
the attributes were... and he also said that at the time of the writing, they
weren't effective.
Any hints? Also, are there any 2.0 changes with regard to the above?
Thanks!!!
Andrew Tag: Windows groups Tag: 116006
How can I pass a different class and method name to a component?
I have a lot of very similar code that moves data from place A to place B.
Code gets new rows to be moved and for each row calls a component. In
addition to that it keeps statistics of how many records were moved and how
many were rejected, what was the throughput, etc. Without going into too
much details, these are two examples:
// Example 1
MyCompany.MyComponent o = new MyCompany.MyComponent();
foreach (DataRow dr in dt)
{
// Get pk
o.MoveOrders (pk);
}
// Example 2
MyCompany.AnotherMyComponent o = new MyCompany.AnotherMyComponent();
foreach (DataRow dr in dt)
{
// Get pk or OrderDate
o.MoveBills (pk, orderDate);
}
I would like to reuse common code by putting it into a base class. My
question is,
how can pass different class name and method name to a generic component?
For example, in the first case I want to instantiate "MyCompany.MyComponent"
and then call "MoveOrders" method with one integer parameter. In the second
case I need
"MyCompany.AnotherMyComponent" class with "MoveBills" method that takes two
parameters, one int and another one DateTime.
Is it possible?
Thanks,
-Stan Tag: Windows groups Tag: 116005
Does anyone know how I can get the list of all available groups in Windows XP ?
z> Does anyone know how I can get the list of all available groups in
z> Windows XP ?
z>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche