|
1) Via PrinterSettings.PaperSizes you cannot add a CUSTOM PaperSize (You CAN do so in .NET Framework 2.0, BUT, it has the SAME BUG!!!)
2) Via DefaultPageSettings.PaperSize you CAN create a custom PaperSize, BUT it is NOT used on the printer...
|
|
|
|
|
I was reading the article C# Server Enumerator By Phil Bolduc
because I am trying to figure out how to build a database connection dialog for an application that should be flexible about which database server and which database I connect to.
My problem is that the sampe code does not run....
If there is a Network Managment namespace somewhere, I don't know where to find it.
I realized this snippet was not comlete because there was no main method, but that is not all that is wrong. Can anybody point out where I am going wrong?
// His code here...======================================================
using System;
using NetworkManagement;
//
// List all the SQL Server database to the
// console (using foreach)
//
Servers servers = new Servers( ServerType.SQLServer );
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
// My code here... ==========================================
using System;
using NetworkManagement;
namespace ConsoleApplication2
{
///
/// Summary description for Class1.
///
class Class1
{
Servers servers = new Servers( ServerType.SQLServer );
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//
// List all the SQL Server database to the
// console (using foreach)
//
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
}
}
}
|
|
|
|
|
|
hi
i create a web application with c# and use code behinde.
its now on my desktop computer and i want to deploy it to my web site.
How i can do it?
|
|
|
|
|
Hi,
You can deploy it by copying the .dll and the content files into correct folder. Or else we can create Web Setup project for deploying the web application.
http://www.15seconds.com/issue/030806.htm Gives you more information on this.
Thanks
SGS
|
|
|
|
|
#1: Does this server support .NET apps (does hit host it, many providers ask for payment for apps).
#2: Does the server has IIS installed, if not, forget it.
#3: if all OK, upload the content files and the dll's (in the bin directory) to the server (keep the directory structure)
#4: Create a virtual folder on IIS and link it to the folder where you copied your app.
#5: now you should be able to surf to the page.
No hurries, no worries.
|
|
|
|
|
When I add items to a ListView control and the amount of items exceed the size of the control a vertical scroll bar appears (I have set scrollable to true and this is what I want). My question is when I continue to add items the ListView control adds the new item at the end of the control (as it should) however the ListView control always shows the items that were entered first. That is I have to use the mouse to drag the scroll bar to see the last entry. Is there a way to program the ListView control so when it adds a new item you see the new item at the bottom of the ListView control without manually dragging the vertical scroll bar?
Thanks
|
|
|
|
|
I guess when you try all day and finally decide to go to the message boards you find the answer.
There is a public Method (EnsureVisible) that will auto scroll the ListView if necessary to make visible the ListView Item of your choice:
lstVwResults.Items[lstVwResults.Items.Count - 1].EnsureVisible();
The above code will ensure the last item added to the ListView control will be displayed.
|
|
|
|
|
I have writen a dll in VC++ project. how can I call the function in the dll from a C# console project?
I think there must be a way. I just don't know how to do it. BTW, I am newbie of C#. I use Visual Studio .Net.
Thank you.
|
|
|
|
|
xianwuluo,
It would help to see the signature of the unmanaged function you want to call, so instead all I can do it point you at the documentation online in the .NET Framework SDK, entitled Consuming Unmanaged DLL Functions[^].
A simple example follows:
EXTERN_C __declspec(dllexport) HRESULT Foo(LPCTSTR pszA, DWORD cchA);
[DllImport("mydll.dll", CharSet=CharSet.Auto)]
static extern int Foo(string pszA, uint cchA);
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
OK, so you want to strip the <b> and </b> tags, you want ALL the other text, including the text inside the bold tags ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
simply i don't want the or in the above i want to exclude them, any help plzz...
regards
|
|
|
|
|
simply i don't want the <b> or </b> in the above i want to exclude them, any help plzz...
thanx and regards
|
|
|
|
|
sorry i didn't see your replys , only when i whent out of the message bord and then returned i found out that i've repeated myself.....
ya actually i just want to exclude the <b> and </b>: eg. (.+(not <b>nor</b>))
|
|
|
|
|
If your just want to remove a fixed part of your string, you could simply use string.Replace("<b>", ""); followed by string.Replace("</b>", ""); to strip out the bold tags.
What remains can then be parsed with regex, of course.
mav
|
|
|
|
|
thanx mav but this will replace the tags witch a space i suppose i just want exclude the tags from appearing with the group when i use this expression:
<td.+><font.+><a.+>(.+)"
i get results desired like:
<prog>Hi to All
but also get undesired extras some times():
<prog>Bob Harris
thanx and regards
|
|
|
|
|
ignore the above i've forgoten to disable html:
<td.+><font.+><b><a.+>(.+)</a></b></font></td>"
i get results desired like:
<Prog>Hi to All</Prog>
but also get undesired extras some times(</b>):
<Prog>Bob Harris</b></Prog>
thanx and regards
|
|
|
|
|
hi there how wud i exclude a certain tag or character using regular exp.:
<a.+>(every character but not the <b> or </b>tag )</a>
!!!!
thanx and regards..
|
|
|
|
|
Match all either side of the tag, and then return the matches ( so the tab is left out ).
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
<a.*><b>(.*+)not any </b><b>or</b></a>
what "expressions" can i use to do the above
|
|
|
|
|
Oh, I see. You want to find inside the tag. Just use non greedy evaluators, and end up with an expression that matches the end. Or use look ahead.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
can u please show me this with an expressions, i'm quite ignorant in regex ....
thanx
|
|
|
|
|
ignore above message:
<a.*>(.*+)not any or
what "expressions" can i use to do the above ..cheers
|
|
|
|
|
You forgot to turn off HTML tags, so I can't see your correction....
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
<a.*>((.*+)not any <b>or</b>)</a>
what "expressions" can i use to do the above
cheers
|
|
|
|