|
cool thanks - i'll look into it
|
|
|
|
|
My problem is this. I want to download a file from the webbserver and save it to a local client. And i the work flow is like this. After the user has register his customer data, he reicive an email with a link to the file on the server and then the dowload starts. I don´t have any idea of how to do this
Could anyone give me some idea´s or example of how to do this or some other way to do this
Sorry for my poor english
|
|
|
|
|
Just create the link to the file, the browser will handle the open/save dialog.
Example: http://yourserver.com/files/update.zip
|
|
|
|
|
Hi, I want to create a button control that scales the image well.
If I use an ordinary Button it won't scale the image at all.
Of course I can create images of correct size, but I want to be able to
allow users to run it with large fonts set and still get the same look.
So What i've done now is override the button and override the onpaint
to draw either a selected "button pressed" image or a "button not pressed"
image. But It would be cleaner to use only a single image and paint the
pressed effect with the ControlPaint.DrawButton(..) function.
So my question is:
does anyone know how wide the button borders are?
Is this dependent on the current font settings also,
or is it always for example 2 pixels?
|
|
|
|
|
i think its usually 2, but what about the themed look?
|
|
|
|
|
i'm a beginner on 3D programming and currently using DirectX 9.0. I have trouble when coding and hope to get help from you guys.
Here are the application requirements:
-application to show warehouse rack in 3D
-user able to view the rack in different angle
-user able to select the item in the rack
-when item selected, the information of the item need to show to user
I does not know how to use mouse to select and show the item info. I hope to get some advices and tutorials or articles on the regarding requirements above.
thanks
|
|
|
|
|
Wow...you've got your work cut out for you. What I would do if I were you:
1. Google like a madman for "Direct3D 9.0 tutorials"
2. Download the DirectX SDK documentation
3. Look heavily into the following areas:
- Microsoft.DirectX.Direct3D.VertexBuffer
- Microsoft.DirectX.Direct3D.Device
- Microsoft.DirectX.Direct3D.Texture
- Microsoft.DirectX.Direct3D.Transforms
- Vector3.Unproject and Vector3.Project
The VertexBuffers hold the "points" that make up the 3D models in your application. The Device is a object that represents the drawing space of your app. Textures are painted onto the 3D models to make them look better, and Transforms are how you move objects around in your "world", as well as your viewing location, or camera. The Project and Unproject methods take a 2D point and convert it into 3D viewspace, and vice-versa.
To summarize, start reading a LOT. You'll be working with a heavy amount of trigonometry, geometry and matrix algebra.
Jeremy Kimball
I have traveled the gutters, lo these many days, with no signs of life. Well met.
-brianwelsch
|
|
|
|
|
|
If you needed another reccomendation on this, here it is. The book is awesome!
|
|
|
|
|
hi,
I am using two RichTextbox controls in my form.
After pressing a button in the form, i want the rtf data of one control to be appended to the other RichTextbox.
rtbox2.rtf = rtbox2.rtf + rtbox1.rtf ; ( is not working )
by giving,
rtbox2.rtf = rtbox2.rtf.substring(0,rtbox2.rtf.length-10) + rtbox1.rtf ;
it is working for the some time. But after changing the colors of rtbox1 data, it is not working ( appending but colors are different from the actual rtbox1 data ).
can any one solve my problem?
M.V.Ravikumar.
|
|
|
|
|
I got the solution.
rtbox2.SelectionStart = rtbox2.rtf.length; ( or rtbox2.text.length )
rtbox2.SelectedRtf = rtbox1.Rtf;
But now, i got another problem.
In the rtbox2 (a rich text box) as the strings are added to it.
The vertical scroll bar is moving up ( means always firstline is shown ).
Can i see the latest contents in the rtbox2, as and when the content is added to it, without manually moving the scrollbar.
I tried with rtbox2.scrolltocaret() ( even after selecting the last character ) . But it is not working.
Can any one solve the problem
M.V.Ravikumar.
|
|
|
|
|
First, you have to put the caret at the end of the text. Then you have to make sure that the RichTextBox has the focus, otherwise, ScrollToCaret will not work.
rtb2.SelectionLength = 0
rtb2.SelectionStart = rtb2.Text.Length()
rtb2.Focus()
rtb2.ScrollToCaret()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how to get sqlserver names in local net,thank you
|
|
|
|
|
This will do it
private const short SQL_HANDLE_ENV = 1;
private const short SQL_HANDLE_DBC = 2;
private const int SQL_ATTR_ODBC_VERSION = 200;
private const int SQL_OV_ODBC3 = 3;
private const short SQL_SUCCESS = 0;
private const short SQL_NEED_DATA = 99;
private const short DEFAULT_RESULT_SIZE = 1024;
private const string SQL_DRIVER_STR = "DRIVER=SQL SERVER";
[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(short hType, IntPtr inputHandle, out IntPtr outputHandle);
[DllImport("odbc32.dll")]
private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr valuePtr, int strLength);
[DllImport("odbc32.dll")]
private static extern short SQLFreeHandle(short hType, IntPtr handle);
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder inString,
short inStringLength, StringBuilder outString, short outStringLength,
out short outLengthNeeded);
static public string[] GetSQLServers()
{
string[] retval = null;
string txt = string.Empty;
IntPtr henv = IntPtr.Zero;
IntPtr hconn = IntPtr.Zero;
StringBuilder inString = new StringBuilder(SQL_DRIVER_STR);
StringBuilder outString = new StringBuilder(DEFAULT_RESULT_SIZE);
short inStringLength = (short) inString.Length;
short lenNeeded = 0;
try
{
if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_ENV, henv, out henv))
{
if (SQL_SUCCESS == SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(IntPtr)SQL_OV_ODBC3,0))
{
if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_DBC, henv, out hconn))
{
if (SQL_NEED_DATA == SQLBrowseConnect(hconn, inString, inStringLength, outString,
DEFAULT_RESULT_SIZE, out lenNeeded))
{
if (DEFAULT_RESULT_SIZE < lenNeeded)
{
outString.Capacity = lenNeeded;
if (SQL_NEED_DATA != SQLBrowseConnect(hconn, inString, inStringLength, outString,
lenNeeded,out lenNeeded))
{
throw new ApplicationException("Unabled to aquire SQL Servers from ODBC driver.");
}
}
txt = outString.ToString();
int start = txt.IndexOf("{") + 1;
int len = txt.IndexOf("}") - start;
if ((start > 0) && (len > 0))
{
txt = txt.Substring(start,len);
}
else
{
txt = string.Empty;
}
}
}
}
}
}
catch (Exception)
{
txt = string.Empty;
}
finally
{
if (hconn != IntPtr.Zero)
{
SQLFreeHandle(SQL_HANDLE_DBC,hconn);
}
if (henv != IntPtr.Zero)
{
SQLFreeHandle(SQL_HANDLE_ENV,hconn);
}
}
if (txt.Length > 0)
{
retval = txt.Split(",".ToCharArray());
}
return retval;
}
|
|
|
|
|
The simplest way is to use SQL-DMO. Right-click on your project and select Add Reference. Click the COM tab and find "Microsoft SQLDMO ..." in the list. Double-click to add it.
Your code is then as easy as this:
SQLDMO.Application app = new SQLDMO.ApplicationClass();
SQLDMO.NameList servers = app.ListAvailableSQLServers();
if (servers != null)
foreach (string server in servers)
Console.WriteLine(server); You can also P/Invoke dbserverenum , though this is rumored to be unsupported in future versions (it's from an old C library). If you use SQLDMO, you'll need to redistribute the interop assembly that VS.NET will create when you add the COM reference to the SQL-DMO library. SQLDMO must be installed, however, on the target machine (this is done by SQL Server and the MSDE).
If you don't want to rely on such client requirements, you'll have to google the net to see if you can find the protocol used to detect SQL Servers on the network.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heyas all,
I'm comming from a unix/c background here and trying to learn .NET. I'm attempting to make a simple cd-database program. What would be the best way to implement the data storage portion of the program (ie. sql database, text file, access database, etc.) The user would have complete control over the datbase create new ones ect.
Thanks all!
kha0s
"There are 10 types of people in this world; Those that know binary and those that do not."
|
|
|
|
|
What do you mean by "cd-database program"? You are going to run it from CD, or you're going to install it from the CD?
If you are installing to the HD you could look at MSDE which is the Desktop Edition of SQL Server and is redistributable.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
My guess is he probably means a cd-collection-catalog. Am I right?
|
|
|
|
|
Hi!
Sorry for the confusion. What I am writing is a program that simply catologs a persons cd's. they enter the information in manually like name, author, etc etc THe user can search using the same fields for a particular cd entered in the catalog. they can add or remove entries as well.
kha0s
"There are 10 types of people in this world; Those that know binary and those that do not."
|
|
|
|
|
I would go with using MSDE as your database engine as you can redistribute it. You can access it via the classes in the System.Data.SqlClient namespace.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Heya,
I've decided to hgo with the MSDE route. However, I've installed the package MSDE2000A.exe. The package extract fine and go to MSDE\ and run setup SAPWD="whatever". THe process compeltes successfully however after rebooting, there is no MSSQLSERVER service listed under services on my machine. I'm running XP with all available updates. Anyone have a clue as to what's going on. Sorry for such a newb question but this is really frustrating me.
Also, I have SQL Server 2000 available to me as well. Would I get the same functionality from that program? Should I use that if I have it instead?
Thanks All.
kha0s
"There are 10 types of people in this world; Those that know binary and those that do not."
|
|
|
|
|
Using DataSet would be an easy solution because you can create those on the fly, from XML or from any database and save changes to those sources.
You can have all the data pre-loaded and have parent/child relations. You can search, sort, filter without depending on the database. Can save to local storage, access database, etc.
In other words, most flexible solution.
|
|
|
|
|
and I have also written something to what you want to write:
http://www.adersoftware.net/?page=oyster
You can download it for free, and if you want to look at the source code, let me know and I can send it to you.
|
|
|
|
|
Hi all,
i would like to set up a logic like this:
A Collection class School which holds different class-members like:
* student
* teacher
* table
* chair
* classroom
* stairs
Member classes have different values (and methods), like:
- student has: name, age and classroom <small>(link to classroom id?)</small>
- teacher has: name
- table has: pointF position, color and tabletype <small>(an enum)</small>- classroom has: pointF[] polyline, ID, classroomtype and MaxPersons
- stairs has: pointF startpoint and pointF startpoint
I would like to get information for all elements in the main class collection using the foreach statement.
Then using it's type i can act on it. For a classroom i could show the position PointF[] on an image and for the students i could show only the students which are in that particular classroom.
Pseudo code:
Foreach element in MainSchoolCollection
If element.type is typeClassroom
PointF[] thePoints = element.vertices[]
element.DrawMyClassroom(thePoints)
int ClassID = element.ID
Foreach element in MainSchoolCollection
If element.type is typeStudent
MessageBox.Show(element.name)
EndIf
EndForeach
EndIf
If element.type is typeStairs
element.StairsToLine(element.startpoint, element.endpoint)
EndIf
EndForeach
So the main issue is that each element in the collectionclass has different properties and methods. When looping through the main collection i would like to use/modify the element's property based on it's type.
Can anyone point me in the right direction here?
Thanks,
Me.
|
|
|
|
|
first, you have to define element and give it a common description, i.e., something that goes for all items. Then, you can implement the IEnumerable interface in all items, so you can use an enumerator.
You might even use an emty interface, which can be used as element in the foreach loop, and then cast the element to the containing type, just as you did.
|
|
|
|
|