|
If you actually read the documentation, you'd see that it's in the System.Web.dll assembly under the System.Web.SessionState namespace (as Mazdak mentioned). You can't simply just use it, though. It's bound to the current HttpContext for a user. You can get this from the HttpContext.Current property (returns the current HttpContext , the class which defines a Session property) and the Page class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
here is my log file from fuslogvw.exe
*** Assembly Binder Log Entry (5/6/2004 @ 10:49:28 AM) ***
The operation failed.
Bind result: hr = 0x800704c7. The operation was canceled by the user.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Droplet\Server\DropletConsole.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = DotNetAppHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39
(Fully-specified)
LOG: Appbase = C:\Program Files\Droplet\Server\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : DotNetAppTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39.
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: DotNetAppHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39
LOG: Cache Lookup was unsuccessful.
ERR: A fatal error occurred when retrieving next codebase for download (hr = 0x800704c7).
i can't figure out what the error is. did it fail to find one of the assemblies - DotNetAppHost or DotNetAppTest?? or is it something else??
thanks.
|
|
|
|
|
DotNetAppTest is the calling assembly. The exception is either in DotNetAppHost or it can't find DotNetAppHost (most likely the latter since Fusion is giving you such a log). The log seems incomplete for an assembly binding error, though, since it doesn't seem to be probing additional, common paths, unless you've removed those lines.
If the assembly was missing, you should've been thrown a FileNotFoundException , which you've either not reported here or are catching in the Application.ThreadException or AppDomain.UnhandledException event handlers (or in a method that late-binds against DotNetAppHost).
To accurately help you solve the problem, please provide more information, such as the complete log (it applicable) or any exceptions that were thrown.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks for the quick reply. that is the complete log. when i look at the output window in VS, i see that both DotNetAppHost and DotNetAppTest are loaded.
|
|
|
|
|
What exactly is the error you're getting, though? Is there any exceptions being thrown from your app (or being caught)?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
whoops. sorry. i meant to do that last post. a message box just pops up in DotNetAppHost which says, 'no source code available for this location.'
|
|
|
|
|
No source code? Unless your using a CodeDomProvider to compile source at run-time, this is not an error you should see. What exactly are you trying to do?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If you write a C# windows forms app, there are two ways in which you can give it the XP themed look :-
(1) is to have the manifest file in the same directory as the exe – this is not very satisfactory and it sucks to have to distribute an extra file with the exe
(2) is to add the manifest as resource to the exe and set its type to RT_MANIFEST and ID to 1 – the problem with 2 is that you have to do this after every re-compilation which sucks
Isn’t there some simple way by which I can tell VS.NET that this resource I added has to be put into the exe as an RT_MANIFEST type resource with ID=1?
I have added the manifest file to the project and changed its Build Action to “Embedded Resource” but there doesn’t seem a way by which I can set the resource type to RT_MANIFEST or ID to 1
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
An embedded resources is embedded in the assembly and referenced by the assembly MANIFEST (like a Java JAR manifest). This is not the same as a resources in the .rsrc section of a PE/COFF executed.
For now, you have to do either of the two things you're doing now. In VS.NET 2005, IIRC, the ability to add the .manifest file to the Win32 executables resources does exist using the IDE.
Without using the IDE, there is another way. You can use the /win32res:<file> switch on the C# compiler (csc.exe, of course) to specify the .res file. The only problem with this is that if you use any automatic versioning (using an asterisk (*) in your AssemblyVersionAttribute - not usually a good idea anyway since versions matter with .NET assemblies) you have to keep this up to date.
If you use a build tool like NAnt, you should be able to use a more complex build script and still use the equivalent of the /win32res switch.
FYI, if you embed your manifest after the assembly is compiled and you signed it (a good idea anyway for many reasons) you'll need to resign it. It's also a good idea to set AssemblyDelaySignAttribute to false and us sn.exe -Vr yourassembly.(dll|exe) to skip verification so you can test it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the info, Heath - it was very useful to me.
Nish
Now with my own blog - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
Request - Could everyone who have in the past, posted on my personal forum on CP, be kind enough to delete all your posts please? I intend to start a personal non-technical blog there, now that it is RSSd and would very much like to empty the forum before I do so - because the posts that are there as of now are mostly test posts and posts that were made before we all knew it was a blog
|
|
|
|
|
Hi,
does anybody know the equation fo finding a point with in a cirlce(ellipse) given the degree of the point and the diameter?
Thanks!
|
|
|
|
|
This should do it:
a = angle
r = radius
x = cos a * r
y = sin a * r
|
|
|
|
|
This is not even vaguely c#, but I'll reward bad behavior anyway:
For a circle:
d=diameter
theta = angle
x = (d/2) * cos (theta)
y = (d/2) * sin (theta)
Elipse is more complex...best bet: use the above to find the equation of the line through the origin at angle theta, then find the intersection of the line with the ellipse. Not hard...just a little algebra (hard enough that I don't feel like doing it for you though )
Bill
|
|
|
|
|
Not sure if this is what you are looking for, but I'm using this to do something similar in a project currently:
public static PointF CircleLineIntersect(float startX, float startY, float angle, float circRadius)
{
double rad =0;
float xx =0;
float yy=0;
float nx=0;
float ny=0;
rad = 6.28 / 360;
//offset angle. 0 deg is top center
angle=angle+90;
double d = Convert.ToDouble(angle * rad);
xx =(float)( Math.Cos(d) * circRadius);
yy =(float)( Math.Sin(d) * circRadius);
nx = (float)(startX - xx);
ny = (float)( startY - yy);
return new PointF(nx,ny);
}
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "It'll be a cold day in Hell when I do VB.NET...", Chris Maunder
|
|
|
|
|
Ok, I should explain my problem, I have a piechart(circle or ellipse), and I want to find the middle point of each pie where the percentage text goes. and given the middle point degree of each pie and diameter.
Example piechart[^]
Can you guys come up with a solution for me please.
Thanks!!
|
|
|
|
|
I'm doing something very similar and used the function I posted.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "It'll be a cold day in Hell when I do VB.NET...", Chris Maunder
|
|
|
|
|
can you explain this "rad = 6.28 / 360;"
Thank you!
|
|
|
|
|
It's a unit conversion. Math.Sin and Math.Cos take the angle in radians, not degrees. 360 degrees = 2*pi (or ~6.28) radians. rad is used in the call to these methods to convert the user supplies angle (in degrees) to the right units (radians).
|
|
|
|
|
Hi Bill, thanks for the message! Finally I sloved my problem
|
|
|
|
|
I have a question about SetForegroundWindow:
My C# Project uses
PS = Process.Start("gsview32.exe", openFileDialog.FileName);
to open GhostView,
then I write
SetForegroundWindow(this.Handle);
to turn focus back to my program,
But I find my program doesn't really activate,
it is in the foregroundWindow,
but I still need to click it to activate,
I try to add this.Activate(); ,
but still doesn't work...
Can anyone do me a favor...?? thanks a lot !!
|
|
|
|
|
Maybe you could use the API-method ShowWindow , which sets the specified window's show state. The most interesting state for you should be SW_RESTORE respectively 9.
<br />
[System.Runtime.InteropServices.DllImport["user32.dll")] <br />
public static extern bool ShowWindow(int wndHandle, int nCmdShow);<br />
<br />
ShowWindow(wndHandle, 9);<br />
For other states take a look at Winuser.h or Windows.h (don't remember which exactly it was).
|
|
|
|
|
I need to make Windows Forms LinkLabel that will on click open same Outlook's "New message" dialog that comes when in Web Forms you link HyperLink with "mailto:bla@bla.com?subject=BLA". I guess I should do something extrelmy easy but still can't find a way to do this e-mail bidding...
tnx in advance...
|
|
|
|
|
Set the LinkLabel.Text to whatever you want, and in the Click event handler add code like so (easiest way - uses default MAPI client):
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "mailto:bla@bla.com?subject=BLA";
psi.UseShellExecute = true;
Process.Start(psi);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
That does same thing as followin code or there is some difference?
<br />
System.Diagnostics.Process p = new System.Diagnostics.Process();<br />
p = System.Diagnostics.Process.Start("mailto:pele@beotel.yu?subject=Gasi!");<br />
Thanks for your response Heath
|
|
|
|
|
It should.
A few things, though - don't instantiate a new Process because you're assigning the process that gets created to the variable. This is a complete waste. Also, unless you plan on doing something with that process, you don't need to store it. Just call Process.Start("mailto:..."); .
Microsoft MVP, Visual C#
My Articles
|
|
|
|