|
Is there any build in functionality to parse standard query string like this:
string1=hello+dear+friend%21&string2=otherdata+here+%25%26
Anything in the framework?
If not I'll write it, should I put it here as an article?
|
|
|
|
|
If you're trying to parse the query string from an ASP.NET page (like an .aspx file), you can use Request.QueryString or Request.Params (combination of POST and GET variables). When getting the value from the parameter dictionary, the values are automatically decoded.
Otherwise, there is many ways this can be parsed, like using String.Split with the &, the doing the same to split the key/value pairs using the = character. The HttpUtility class has both a UrlDecode and UrlEncode method, both overloaded.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanx for the tip, but unfortunatly "UrlDecode" didn't work ok with some national characters like 'Ö'. So I wrote my own, and it works ok, using Uri.HexDecode.
|
|
|
|
|
The problem is simple:
I need to launch the default mail client (mailto: won't help here), open a new message and add some attachments to it. I need to do the same as when the user right-clicks a file and selects "Send to->Mail recipient". I need a solution that works for all mail clients and not just Outlook... and I need it quickly
|
|
|
|
|
|
Thanks, but your solution is not the answer which I wished.
|
|
|
|
|
This is what the items in the Send To menus of most application work. It uses MAPI, and that's the only way to talk to multiple mail clients because it's a set of interfaces (contracts) by which supporting clients communicate. If his solution isn't what you want, then read about MAPI and implement your own solution, but you won't find another abstract way; MAPI is the abstract API that Microsoft developed for this very purpose.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi there,
I have started to learn C# last week for a project. I'm starting to get the philosophy of the language. It's not so hard.
I have a project to design that will run Excel 2003.
I have installed the Office 2003 extensions for VS .NET 2003.
For my project, I want to use the following Excel 2003 functionnalities:
- read/write Excel files (worksheets and workbooks) and also use the file import manager (for reading formatted text files, like excel does)
- Input data in a sheet (from a grid in the application)
- insert and retrieve data in sheets (to display them in a grid in the app)
- use Excel 2003 statistical functions
- display an Excel 2003 chart (this chart is calculated by excel, and the application displays the result in a dialog box for example)
- communicate with Excel WITHOUT the fact that excel is running
I wanna do all of these in a stand alone application while Office 2003 will be installed on the target machine.
This application won't RUN Excel!!! It will USE it!
I see that Excel 2003 can be accessed via C#.
Can any one tell me if it's possible to do these things?
And also, can you show me where I can get links with sample code to do basic calls to Excel 2003 functionalities and retrive the results via C#?
Thanks to all.
Best regards.
|
|
|
|
|
|
I'm trying to create my own "mp3 player" i c# using the Windows media player 9 control.
1. How do I create a playlist and add files to them?
2. How do you use the EndOfStream event?
/fleischen
|
|
|
|
|
I'm using Windows media player series 9
|
|
|
|
|
Dear all,
How can I use OpenGL in C#?
Islam Hegazy
|
|
|
|
|
http://csgl.sourceforge.net/[^]
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
Does anyone know the if this is something already present in C# or will I have to figure out the file format to read dbxs?
------------------------------------
Proud owner of a Peacekeeper barbie
37,064+ lines of code in my basketball game and it still doesn't have a game engine. I rule =)
|
|
|
|
|
Have you try to import Outlook Express Message List/Mail Object or other COM component which exist and usable in c# too?
Mazy
"A useless but amusing fact is that if all the DNA in all the cells in a single human being were stretched out it would reach the moon and back eight thousand times." - Steve Jones
|
|
|
|
|
I am trying to use the method SizeOf to determine the size of a structure containing arrays, among other elements. I succeeded in doing this by using MarshalAs with UnmanagedType and SizeConst. This works for structures with simple arrays, but for more complicated structures (such as nested ones), it compiles and links, but bombs during execution.
Below is sample code, with comments indicating exactly which line of code makes it bomb, and exactly where it bombs.
Do you have any suggestions? (I am running on .NET)
Thank you very much.
using System ;
using System.IO ;
using System.Runtime.InteropServices;
public class classMain
{
public static void Main ()
{
System.Type type = typeof (CLASS.STRUCT) ;
/* Here it bombs: ===> */ int length = Marshal.SizeOf (type) ;
return ;
}
}
public class CLASS
{
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct float_3
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 3 )]
public float [] FLOAT ;
}
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct float_3_3
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 3 )]
public float_3 [] FLOAT_3 ;
}
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct STRUCT
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 10 )]
ushort [] USHORT ;
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 2 )]
/* This makes it bomb: ===> */ public float_3_3 [] FLOAT_3_3 ;
}
}
zelbezach
|
|
|
|
|
can some1 tell me where to get a small instal file 4 C# or can some1 please send me a winzip or rar file with it in it
|
|
|
|
|
If you mean that you want the c# SDK you can download that free from the microsoft webpage. But then you must use the command prompt to compile your code. The most c# programmers use Visual studio.NET but this is very expensive.
There is also an opensource development app (called sharpdevelop) available at
http://www.icsharpcode.net/OpenSource/SD/
|
|
|
|
|
Okay, first of all you must understand that C# as a language cannot exist by itself (unless you want to write your own compiler). The C# compiler targets the Common Language Runtime (CLR), part of the .NET Framework, just like VB.NET, MC++, J#, Perl.NET, and MANY others. You have to download and install the .NET Framework, which is a 20+ MB install. You can't do squat without it (just like you can't build an application using C# and deploy it to a computer without the .NET Framework installed. This is a framework, just like Java uses a Java Virtual Machine. Without, it doesn't work. C/C++ also requires a runtime, just as VB6 and older does.
You can download the free runtime (includes compilers) from http://msdn.microsoft.com/netframework[^]. You can also download the SDK from this link, which includes additional utilities and the SDK documentation, which you really should read. You'll also find some helpful articles to get an overview of .NET from the link. Definitely do the reading and don't fumble around blind. Understanding how .NET works and where C# fits in, as well as having some idea of what is provided in the base class library is important in development.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi. I am a beginner in C# and I have a question.
How can I include what my program needs in the instalation kit?
I know I can put dotnetfx.exe in my setup, but the file is to big.
Is there any other solutions?
Thanks
|
|
|
|
|
adyrds wrote:
I know I can put dotnetfx.exe in my setup, but the file is to big.
Is there any other solutions?
It is just like anything else. If the
end user doesn't have the requried runtime
then you have to put it there. I don't know
how you would ever get around that.
Granted .Net has the mother of all runtime.
Thank You
Bo Hunter
|
|
|
|
|
You can use something like NSIS and download it from MS on demand
jkerns
|
|
|
|
|
The .NET Framework is required for an application that uses the .NET Framework, just like you can't run a Java app without the JRE.
There are ways to bootstrap the setup, but this will either require that the .NET Framework setup be included with the installation media (on a CD, this is hardly an issue) or must be downloaded on-demand, which imposses network requirements for clients. For information about this, see Redistributing the .NET Framework[^] on MSDN. Also note that the Windows Installer project in VS.NET will automatically include a .NET MSM (merge module) and exlude it from the installation. This is because it is only meant to resolve dependencies of base class library assemblies for assemblies in your installation and is not a valid installation of the .NET Framework. This is also documented in the VS.NET help.
There are commercial ways to bootstrap the .NET Framework, as well as free ways. For commercial ways, I recommend Wise for Windows Installer[^], but you can use InstallShield too (as an installation consultant for several companies and a tester/user of both IDEs, I've always preferred Wise Solutions). You can also find many free alternatives, such as Enhanced .NET Bootstrap Setup[^] on CodeProject.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I have a very simple problem
How can i create a popup menu
i know how to create menus, mainmenus and menuitems (I don't use the grafical studio.NET development interface, but i write all the code i need self)
a half year ago i use VB6 there i always used the method
PopUpMenu Menu1
I know there must be a very simple solution.
thanks to everyone who can help me
|
|
|
|