|
i want find a class which can analyse HTTP.
i have the HTTP string,
HTTP 1.0
Connection: keep-alive
Browser: IE40
........
i want input the HTTP string and the class can out put anything i need.
such as System.Web.HttpRequest is very good.but i can't find any method can input string, what class should i use?
|
|
|
|
|
Be patient - you asked this question just a few moments earlier.
Read my response to your previous question.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
When we view any document in print preview dialog, where does it save the document? such that when me move to next/previous page where it reads the information from . If a heavy document like RTF file having images and large number of pages is viewed in PrintPreview, does it affects the system speed? What happens at application level?
please guide
regards
|
|
|
|
|
It's stored in memory, the same as all other objects in an object-oriented application (or even just variables in procedural languages - it's all about memory).
If you have large documents and don't want to buffer them all in memory, then you need to implement drawing routines from cached objects. For instance, if you get an event notificatin that the first page is being drawn, you should have to grab the first page full of what the document contains, leaving the rest on disk (when applicable).
Typically this is not a problem, though. In most applications, when you load a document (Word document, HTML document, Photoshop Drawing document, whatever) the whole thing is loaded into memory anyway. If you draw from that document, then only a single copy is read into memory for both displaying and printing. Certain things can affect this, however.
So, if you make your document class derive from PrintDocument , then you only need to have one reference loaded. When you assign your document object to the PrintPreviewDialog.Document property, for example, a reference is saved - not a copy of the document.
You don't have to derive from PrintDocument , either. Just make sure that any printing routines query your document object for how to print and you can save memory.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have written 3 class libraries and want to share among different applications. How can I do that?
Thanks
|
|
|
|
|
In the Solution Explorer, right-click on the "References" folder and select "Add Reference...". On the .NET tab, click the "Browse..." button and locate your class libraries' *.dll files and add them as needed. From there, they are part of your project and ready for use.
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
um.. i mean how can i use the same dll in different applications? i don't want my device to have multiple copies of the dll
thanks
|
|
|
|
|
Install the assembly into the Global Assembly Cache (GAC). You can do this using gacutil.exe that ships with the .NET Framework (the runtime, not the SDK, so every machine with .NET installed will have it), or a Windows Installer project.
When developing the application, you must still reference the DLL when building (and I recommend a Project reference as opposed to a file reference if these projects are in the same solution - just select the Projects tab when adding a reference). When you run the application, however, if the assembly name is found in the GAC (where the CLR first looks) it will use that copy. Otherwise the CLR reverts to a local copy or a location defined in the app's .config file.
To install into the GAC, your assembly must be strong named, which means it must be signed (always a good idea anyway).
To generate a key pair, use:
sn.exe -k KeyFile.snk Use the path to that file in the [assembly: AssemblyKeyFileAttribute[ you typically find in your projects' AssemblyInfo.cs files. I recommend using the same one for all your assemblies, or at least for a particular project.
You should also disable automatic versioning of the shared assembly by getting rid of the asterisk (*) in the [assembly: AssemblyVersionAttribute] (also commonly found in the AssemblyInfo.cs file, though they can go anywhere). If you use automatic versioning, you'll need to install a new copy into the GAC with every change. Instead, just managed the version numbers yourself for much better control.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
To add to what Heath said...
You should have all of the shared DLL's in a single directory. For example, if every developer gets a network shared drive that is a G: drive, then I'd put them in the G:\Shared Utils directory.
Once you get them added to the GAC, then you need to create a single registry key entry:
HKLM/Software/Microsoft/.NetFramework/AssemblyFolders/{companyname}SharedFolder
Then set this key to the value G:/Shared Utils
This is required if you want your shared dll's to show up in the Add Reference dialog under the .NET dll's.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
want find a class which can analyse HTTP.
i have the HTTP string,
HTTP 1.0
Connection: keep-alive
Browser: IE40
........
i want input the HTTP string and the class can out put anything i need.
such as
System.Web.HttpRequest
is very good.
but i can't find any mother can input string, what class should i use?
|
|
|
|
|
What???
You can use the System.Net.HttpWebRequest and System.Net.HttpWebResponse and get this information using properties like the Headers dictionary property that each class has, such as:
string someHeader = response.Headers["SomeHeader"]; Many HTTP headers has specific properties, like the ContentType . Read over the documentation for the HttpWebRequest and HttpWebResponse class - part of the pluggable protocol implementation - in the .NET Framework SDK.
Class in System.Web.* namespaces are for ASP.NET and should not be used outside of ASP.NET except in uncommon cases and when you know that they can work (unliked the class you mentioned) outside ASP.NET.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i have seen the MSDN.
but it told me.
don't create HttpWebResponse directly,you should get it from HttpWebRequest.GetResponse.
but i don't have any HttpWebRequest.i only kown the HTTP string
GET /?forumid=1649&fr=51 HTTP/1.1<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, *
i want use an analyser to get the HTTP heads and Params. i want input HTTP string and the analyser can give me anything i want,just like System.Web.HttpRequest.
|
|
|
|
|
Then just do simple line parsing? Use a StringReader and loop through the lines. Split the line on the first colon found:
StringDictionary lookup = new StringDictionary();
using (StringReader reader = new StringReader(httpString))
{
string methodAndRequest = reader.ReadLine();
if (methodAndRequest != null)
{
line = reader.ReadLine();
while (line != null)
{
if (line == "\r\n") break;
string[] header = line.Split(new char[] {':'}, 1);
if (header.Length == 2)
lookup.Add(header[0].Trim(), header[1].Trim());
}
}
}
Console.WriteLine(lookup["Host"]); It's a simple parsing algorithm. If you want, you could further break-down known headers to typed classes or whatever you want to do.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi
My simple question is, how do I controle wich user controle is drawn atop and wich is below, whenever these are placed in the same area?
I would like to tell one of the controles to stay on top, and the other to go belov, like a Z index.
Regards
Janus
|
|
|
|
|
The last two buttons (by default) on the Layout tool in Visual Studio.NET deal with control layering. Hope this helps.
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
To do this programmatically call either BringToFront or SendToBack method which are inherited from the Control class.
www.troschuetz.de
|
|
|
|
|
Thank you very much
So simple
|
|
|
|
|
As a sitenote I can just tell you all that you have to call these methods, after you add your controls to your form/panel and so on.
Like this:
this.Controls.Add(line1);
line1.BringToFront();
And NOT:
line1.BringToFront();
this.Controls.Add(line1);
Dont know why, but I found out the hard way
Thank you again, for your quick answer ;o)
|
|
|
|
|
When you add your line1-control to the collection of controls, the z-order is updated with the line1-control added to the back, so that the previously called BringToFront method has no effect.
www.troschuetz.de
|
|
|
|
|
How can I set DataGrid row properties depending on its contents (i.e. if the value in column 3 is equal to "Mike" then set the full row background to yellow, if it is equal to "Bob" set the background to cyan, and so on) ?
Thank you for your help.
Maurizio Poggi
|
|
|
|
|
|
I want to get Email Address from WAB ,but I dont't konw how to do . If someone know it ,please help me. I am waiting on line.
|
|
|
|
|
It's not very simple at all. There are articles out there (did you try googling?), though not many using .NET languages like C#.
Look through the MSDN Online Library[^] for the IAddrBook interface. You'll have to re-declare these interfaces in managed code because the typelib importer won't be able to. You'll also have to P/Invoke all the related functions also listed in the documentation under Widnows Address Book[^] in the Web Development section.
Make sure you have a good working knowledge of unmanaged types vs. managed types, like that an unmanaged long is actually a managed int (Int32 ). It also helps to understand COM interop in .NET. Read the section Interoperating with Unmanaged Code[^] in the .NET Framework SDK for more information about both P/Invoke and COM interop.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am using word 10.0 object library for the printing of the creation of a word document ( with office 2002) it works fine on windows xp but when i deploy the same application on windows 2003 server it doesn't work.
The following Error is generated
" Message Filter Application is Busy";
Can anyone help in this regard
|
|
|
|
|
many anti-virus softwares have they own virus database for scaning.
also i want to build my own database for scaning.
But i dont know how to build one.
and how to search items quickly in the database?
|
|
|
|