|
Dear all experts ,
I need to do a Pocket PC application, a wireless management system,
basically liek this, person A use PocketPC (ipaq) OS: win mobile / win ppc 2002 or 2003.. access to wireless access point, and retrive data from a Server ( desktop).
Normally, it will retrieve some data like doc file, exel, picture... but he can upload the file to the server too.
beside this, once it access the server via Wifi, he can sync his inbox message, some announcement, or notes....
so basically, its a office management system...
So i have chosen C# .net for my application, but after reading 2 big books, i am still blur with everything .. i want to ask ..
1.how can i create "login page", basically a testbox for username and a testbox for password, then a button to "login", i think i will be using sql, so i need the coding to connect to sql CE server and verify the password..
can anyone show me the how can it be done ?
2. let say i at form 1, then supose i want to go to another form which is form2 , how i going to link it to form2 ? Onfocus ?
Thanks all, appreciate it !
|
|
|
|
|
can anyone help me on this ?
thanks !
|
|
|
|
|
hi all,
I am new to c# so please help me here...
I am tryin to build a HTML compare tool, which opens two htmls with the same name from diff folders. I am using two axwebbrowsers to view the htmls(both are present in the same form).
I now want to add synchronized scrolling to the axwebbrowsers(i.e when one window is scrolled the other is scrolled to the same extent to assit a visual caompare).
Can anyun please help me here? is my choice of axwebbrowser right? or can i use something else?
any help will be appreciated
|
|
|
|
|
Hi,
How do i change the color of the text in a treeview to a diff color ?
Saleem
|
|
|
|
|
Hi!
Exactly like everywhere else: set the node's appropriate ForeColor .
mav
|
|
|
|
|
Thanx,
It's very simple....
saleem
|
|
|
|
|
Hi friends....
I have a problem ,the code snippet is given below.
I have a mfc shared memrory dll class.I want to instanciate an object of this class in C# .Can you provide some code sample to achieve it.
#ifdef _FtpChannel
#define _EXPORT_IMPORT_FtpChannel __declspec(dllexport)
#else
#define _EXPORT_IMPORT_FtpChannel __declspec(dllimport)
#endif
class _EXPORT_IMPORT_FtpChannel CFtpMessage : public IConnection
{
private:
public:
CFtpMessage();
~CFtpMessage();
};
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
hello,
my application asks the user to enter a few words and the application arrange these words to create a 15x 15 crossword puzzle .
do you know any alogrithm that can help me to arrange the words in a way that gets the best result
|
|
|
|
|
|
I have the following and have the error when I try to close the FileStream. It says cannot access fs as it no longer exist. something like that.
But I did not delete it.. I have this problem when I have the close the Stream Reader statement. Also, shouldn't the if statement work in checking if the FileStream still exist?
I'm Confused
<br />
string path = @"c:\TrayCount.txt";<br />
<br />
fs = new FileStream( path, FileMode.OpenOrCreate , FileAccess.ReadWrite, FileShare.ReadWrite);<br />
<br />
sr = new StreamReader(fs);<br />
sw = new StreamWriter(fs);<br />
<br />
<br />
if(sr!=null)<br />
sr.Close();<br />
<br />
if(sw!=null)<br />
sw.Close();<br />
<br />
if(fs!=null)<br />
fs.Close();
|
|
|
|
|
Closing a reader or writer also closes the associated FileStream
|
|
|
|
|
well I checked the documentation for this and indeed it is right ... closing the streamreader/writer will close the stream associated with it.
For some wierd reason till today I always use to assosciate one filestream to one reader / writer ... gladly never faced this problem
I dont know if they got the implementation right. you are exclusively stating that you want FileShare mode and when u do that u expect that this filestream is going to be shared.
I think they should have provided a reference count on SHARED system resource or atleast in IOStream .... espescially when it is explicitly indicate that u expect the filestream to be shared.
might be worth taking up this to msdn
Pushkar Pathak
|
|
|
|
|
The other thing i'm still confused is that of the if statement.
Shouldn't if( fs!=null) be enough to check that the filestream has already closed?
|
|
|
|
|
Why should closing a FileStream object set your reference to null ?
Calling Close on a FileStream means calling a method of an object, like every other method call. For your reference to be null after the call I'd assume there'd have to be the line this = null; somewhere in FileStream.Close() and I strongly doubt that this works...
mav
|
|
|
|
|
|
Calling Dispose() doesn't make the object eligible for garbage collection. An object will be GC'ed only if there are no live references to it.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi,
anyone know how to add a file/shortcut to All User's Desktop?
currently, i know how to add to user desktop(user install the application). however, not all the case user account is same as installation user account.
any help?
thanks,
jim
|
|
|
|
|
Easy, same as what you've been doing, only the path is C:\Documents and Settings\All Users\Desktop.
Hard. Not everyone has the appropriate permissions to write to that folder.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm experimenting with using GDI from C# and I'm not having much luck with the GradientFill function. Anyone managed to get this working? (Google/pinvoke.net are not much help )
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Why ?
Do you mean you can't call it, or it does nothing ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
why?
why not? (For my article XPExplorerBar[^] I'm doing animation with transparency which can be quite slow using GDI+. Thought I might try the same thing with GDI since it is hardware accelerated to see if I can get a decent performance boost)
Do you mean you can't call it, or it does nothing?
It doesn't do anything, yet GradientFill returns that it was successful. This is what I have so far:
[DllImport("Msimg32.dll", CharSet=CharSet.Auto, SetLastError=true)]<br />
public static extern bool GradientFill(IntPtr hdc, TRIVERTEX[] pVertex, int dwNumVertex, ref GRADIENT_RECT pMesh, int dwNumMesh, int dwMode);<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct TRIVERTEX <br />
{<br />
public long x;<br />
public long y;<br />
public ushort Red;<br />
public ushort Green;<br />
public ushort Blue;<br />
public ushort Alpha;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct GRADIENT_RECT <br />
{<br />
public ulong UpperLeft;<br />
public ulong LowerRight;<br />
}<br />
<br />
public bool FillRectangle(IntPtr hdc, Color startColor, Color endColor, int x, int y, int width, int height)<br />
{<br />
TRIVERTEX[] vert = new TRIVERTEX[2];<br />
GRADIENT_RECT rect = new GRADIENT_RECT();<br />
<br />
vert[0].x = x;<br />
vert[0].y = y;<br />
vert[0].Red = (ushort) (startColor.R << 8);<br />
vert[0].Green = (ushort) (startColor.G << 8);<br />
vert[0].Blue = (ushort) (startColor.B << 8);<br />
vert[0].Alpha = 0;<br />
<br />
vert[1].x = x + width;<br />
vert[1].y = y + height;<br />
vert[1].Red = (ushort) (endColor.R << 8);<br />
vert[1].Green = (ushort) (endColor.G << 8);<br />
vert[1].Blue = (ushort) (endColor.B << 8);<br />
vert[1].Alpha = 0;<br />
<br />
rect.UpperLeft = 0;<br />
rect.LowerRight = 1;<br />
<br />
return GradientFill(hdc, vert, 2, ref rect, 1, 0);<br />
}
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Hi every Body iam new C# developer to that great site with great background about C#
i thank everybody here for continous knowledge they offer here
so i need to develop A program with timer after specific time it logs off windows the same as log off code in microsoft windows when you click the following
start > log off > then you will see three buttons appear in borderless form then don't press any button just you will see the desktop is becoming deactivated and become like just image you can't press any thing on your desktop except when you click cancel button
i want to do something like that with C# is there any help about that please
please refer to me at
snouto@phreaker.net
Miss With The Best And Die Like The Rest
|
|
|
|
|
To do stuff like that, you need to interop the C dlls. www.pinvoke.net is the best place online to get info on that stuff. Google the C API calls first, then go there to see how to interop them.
public class Shutdown<br />
{<br />
[StructLayout(LayoutKind.Sequential, Pack=1)]<br />
internal struct TokPriv1Luid<br />
{<br />
public int Count;<br />
public long Luid;<br />
public int Attr;<br />
}<br />
<br />
[DllImport("kernel32.dll", ExactSpelling=true) ]<br />
internal static extern IntPtr GetCurrentProcess();<br />
<br />
[DllImport("advapi32.dll", ExactSpelling=true, SetLastError=true) ]<br />
internal static extern bool OpenProcessToken( IntPtr h, int acc, ref IntPtr phtok );<br />
<br />
[DllImport("advapi32.dll", SetLastError=true) ]<br />
internal static extern bool LookupPrivilegeValue( string host, string name, ref long pluid );<br />
<br />
[DllImport("advapi32.dll", ExactSpelling=true, SetLastError=true) ]<br />
internal static extern bool AdjustTokenPrivileges( IntPtr htok, bool disall,<br />
ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen );<br />
<br />
[DllImport("user32.dll", ExactSpelling=true, SetLastError=true) ]<br />
internal static extern bool ExitWindowsEx( int flg, int rea );<br />
<br />
internal const int SE_PRIVILEGE_ENABLED = 0x00000002;<br />
internal const int TOKEN_QUERY = 0x00000008;<br />
internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;<br />
internal const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";<br />
internal const int EWX_LOGOFF = 0x00000000;<br />
internal const int EWX_SHUTDOWN = 0x00000001;<br />
internal const int EWX_REBOOT = 0x00000002;<br />
internal const int EWX_FORCE = 0x00000004;<br />
internal const int EWX_POWEROFF = 0x00000008;<br />
internal const int EWX_FORCEIFHUNG = 0x00000010;<br />
<br />
private static void DoExitWin( int flg )<br />
{<br />
bool ok;<br />
TokPriv1Luid tp;<br />
IntPtr hproc = GetCurrentProcess();<br />
IntPtr htok = IntPtr.Zero;<br />
ok = OpenProcessToken( hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok );<br />
tp.Count = 1;<br />
tp.Luid = 0;<br />
tp.Attr = SE_PRIVILEGE_ENABLED;<br />
ok = LookupPrivilegeValue( null, SE_SHUTDOWN_NAME, ref tp.Luid );<br />
ok = AdjustTokenPrivileges( htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero );<br />
ok = ExitWindowsEx( flg, 0 );<br />
}<br />
<br />
public static void ShutDown()<br />
{<br />
DoExitWin( EWX_POWEROFF | EWX_FORCE );<br />
}<br />
}
That's a class that shuts down windows, I reckon that changing the flags you pass in should log off instead.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I have managed to get succesfully working the , delete and cancel functions working within the datagrid to alter data held in dataset that then updates a SQL Database.
When I click edit the correct row changes into textboxes to make the changes. Then when I click update is when I get stuck. I am using the datagrid (dgCustomers) items index and DataKeyField (CustomerID) to search for the correct row within the dataset, to update.
here is the code:
private void dgCustomers_UpdateCommand(object source, system.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// //Test Label to see the value of the datakey is correct
Label6.Text = dgCustomers.DataKeys[e.Item.ItemIndex].ToString();
//Select correct row using the index and datakeyfield.
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'dgCustomers.DataKeys[e.Items.ItemIndex]'");
//Make sure there is data
if(adrEdit.Length > 0)
{
//Put in the edited data
TextBox txtCompanyName = (TextBox) e.Item.Cells[3].Controls[0];
adrEdit[0]["CompanyName"] = txtCompanyName.Text;
TextBox txtContactName = (TextBox) e.Item.Cells[4].Controls[0];
adrEdit[0]["ContactName"] = txtContactName.Text;
}
else
{
LblResult.Text = "Not Updated";
}
//End editing
dgCustomers.EditItemIndex = -1;
//Update the database
da.Update(ds,"Customers");
//And bind data to the ui
LoadData();
}
For some reason it doesn't find the necessary data and skips the if loop. The test label(label6) however does return the value of a customerID suck as ALFKI.
If I replace this row
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'dgCustomers.DataKeys[e.Items.ItemIndex]'")
With this more explicit statement
DataRow[] adrEdit = ds.Tables["Customers"].Select("CustomerID = 'ALFKI'")
It actually works, but obviously updates only the ALFKI row. Can anyone shed any light on where I may be going wrong, or is it just my comp playing funny buggers with me again!
Many thanks
Paul Custance
|
|
|
|
|
Hello everyone,
I found an articles in msdn which is "Receiving SMS Messages Inside a Managed Application". I download the sample code and run it.This project contains two separte projects "mapirule" and "CaptureSMS". Mapirule was implemented by using embedded Visual C++ 4.0 and CaptureSMS contains managed code only which was implemented by using Visual Studio.NET 2003
When I built mapirule.dll in embedded C++4.0, the error "download file failed" occurred. When I tested the sample code on an emulator and clicked Start IMailRuleClient". Error message "The function is not defined" ("registerServer function). This function is defined in mapirule. How come mapirull.dll can't be loaded? Is there anyone who can give me any suggestion.It's urgent. Thank you veryyyy much.
Co
|
|
|
|
|