|
|
You could add a parameter to the autostart shortcut and check for it when the program starts.
Or check the TickCount. If it's really low, the system was just started
|
|
|
|
|
The possibility with the command line parameter came to my mind too shortly after posting. Guess I will use it, cause the TickCount may be a bit imprecise .
THX
www.troschuetz.de
|
|
|
|
|
Hi all,
i have table inside dataset there is a one row and one columne i need to retrive this value into string
thanks
haytham
|
|
|
|
|
webhay wrote:
i have table inside dataset there is a one row and one columne i need to retrive this value into string
Say, the dataset is called dset, for some reason!
then dset.Tables[0].Rows[0].ItemArray[0].ToString() should retrieve the first column in the first row in the first table, which you seem to be absolutely certain of.
Cheers!
<bold>Looney Tunezez
"If you build it....
.....BUGS will come!" -JB
Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
"Stability. What an interesting concept" - Chris Maunder
<bold>
|
|
|
|
|
|
Assuming you want row x, column y, and assuming the DataSet object is named "ds" and DataTable's TableName is "MyTable", how about:
object value = ds.Tables["MyTable"].Rows[x][y];
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
i have the following problem:
1. i have an interface with few methods which i cannot change.
2. i am creating a base class that realizes the methods which are defined
in that interface (but this class doesn't inherit from the interface).
This class will be called the "Base" class.
3. i have 2 other classes which inherits from both the interface and the base class. (will be
referenced as Classes A and B)
what i need is this:
the base class should hold all the similar functionalities (methods) for both A and B which are also defined in the interface. i want to remove all these methods from A and B.
it doesn't compile with an error that says i am not realizing the interface's methods inside A and B (but they ARE realized in the base class which A and B are inheriting from).
is there a way to make this work?
Thanks.
|
|
|
|
|
Simple: implement the interface on Base and mark the methods that need to be different on the derived classes as "virtual" or "abstract". Then, override as needed.
Yes, even I am blogging now!
|
|
|
|
|
|
<br />
using System;<br />
namespace ConsoleApp<br />
{<br />
public interface IMe<br />
{<br />
void Disp();<br />
}<br />
abstract class BaseCls<br />
{<br />
public virtual void Display()<br />
{<br />
<br />
}<br />
}<br />
class B:BaseCls,IMe<br />
{<br />
public void Disp()<br />
{<br />
Console.WriteLine("i am from interface");<br />
}<br />
public override void Display()<br />
{<br />
this.Disp();<br />
}<br />
}<br />
class Implimet<br />
{<br />
static void Main()<br />
{<br />
B Bobj=new B();<br />
Bobj.Disp();<br />
Bobj.Display();<br />
}<br />
}<br />
}<br />
<br />
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I am currently working on UPNP technology with c#.
http://www.intel.com/technology/upnp/. Anyone interested in a chat on how to develop upnp devices using C#.Sample source code sharing and innovative ideas will help all developers work with the technology of the future.
Kill The Tester
|
|
|
|
|
|
"RasGetProjectionInfo" function in MSDN.
this is right?
[DllImport("Rasapi32.dll", CharSet = CharSet.Auto)]
public static extern uint RasGetProjectionInfo(IntPtr hrasconn,RASPROJECTION rasprojection,[Out]RASPPPIP[] test,ref int size);
public struct RASPPPIP
{
[MarshalAs(UnmanagedType.U4,SizeConst=4)]
public uint dwSize;
[MarshalAs(UnmanagedType.ByValArray,SizeConst=44)]
public byte[] bt;
}
public enum RASPROJECTION
{
RASP_Amb = 0x10000,
RASP_PppNbf = 0x803F,
RASP_PppIpx = 0x802B,
RASP_PppIp = 0x8021,
RASP_PppCcp = 0x80FD,
RASP_PppLcp = 0xC021,
RASP_Slip = 0x20000
}
when i call this function in C#,it's return 632 or 87...
int ii = 0;
RASPPPIP[] rasPPPIP = new rasPPPIP[1];
rasPPPIP[0].dwSize = (uint)Marshal.SizeOf(typeof(RASPPPIP));
RasFunction.RasGetProjectionInfo(connectedRasHandle,RASPROJECTION.RASP_PppIp,rasPPPIP,ref ii);
"connectedRasHandle" is correct,and i can call RasHangUp(connectedRasHandle)
I'm going crazy ...
Help !
|
|
|
|
|
MSDN docs have it down in black and white. A non-zero return code means that you have a problem.
632 - ERROR_INVALID_SIZE - The dwSize member of the structure pointed to by lpprojection specifies an invalid size
87 - ERROR_INVALID_PARAMETER - One of the parameters is invalid
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
But , How can I do?
I call this function in VC++6.0 is correct!and the dwSize=48,In C# as same as VC++.
Help
|
|
|
|
|
I got it for you
Use this as the struct definition:
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
public struct RASPPPIP
{
public uint dwSize;
public uint dwError;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szIpAddress;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szServerIpAddress;
public uint dwOptions;
public uint dwServerOptions;
}
Call like this:
RASPPPIP info = new RASPPPIP();
info.dwSize = 72;
int size = 72;
RasGetProjectionInfo(r.hrasconn, RASPROJECTION.RASP_PppIp, ref info, ref size);
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hello all, when I tried the solution as it was posted it did not work for me I am trying to call RasGetProjectionInfo by Pinvoking the rasapi32.dll on WinXP. I have no problem connecting to my RAS server but When I pass it back the appropriate params and structures I get back empty strings for szIpAddress and szServerIpAddress or if I modify my code to CharSet=CharSet.Unicode I get nulls.. ( listed below is the code )
Any help would be appreciated.., Thanks
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Auto)]
public class RASPPPIP
{
public uint dwSize = 72;
public uint dwError;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szIpAddress;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)]
public string szServerIpAddress;
}
public enum RASPROJECTION:uint
{
RASP_AMB = 0x10000,
RASP_PppNbf = 0x803F,
RASP_PppIpx = 0x802B,
RASP_PppIp = 0x8021,
RASP_PppCcp = 0x80FD,
RASP_PppLcp = 0xC021,
RASP_Slip = 0x20000
}
[DllImport("rasapi32.dll",CharSet=CharSet.Auto)]
public extern static uint RasGetProjectionInfo(
IntPtr hRasConn,
RASPROJECTION projection,
[In,Out] RASPPPIP pppip,
ref uint ppipSize
);
and the calling function ...
public void Dial()
{
if(_Handle!=IntPtr.Zero)
{
RASCONNSTATUS status=new RASCONNSTATUS();
uint res=Ras.RasGetConnectStatus(_Handle,status);
if(res==6) //res=ERROR_INVALID_HANDLE
_Handle=IntPtr.Zero;
else
return;
}
try
{
Ras.RasCheck(Ras.RasDial(null,_Phonebook,_Params,1,_DialNotifyDelegate,ref _Handle));
Ras.RasConnectionNotification(_Handle,this._DisconnEvent.Handle,RASNOTIFICATION.RASCN_Disconnection);
RASPPPIP pppip = new RASPPPIP();
uint size = pppip.dwSize;
uint ipstatus = 0;
ipstatus = Ras.RasGetProjectionInfo(this._Handle,RASPROJECTION.RASP_PppIp,pppip,ref size);
StartWatch();
}
catch(RasException e)
{
OnError(e.ErrorCode,e.Message);
}
}
|
|
|
|
|
I got it to work by making the following changes to my original code.
[StructLayout (LayoutKind.Sequential,CharSet=CharSet.Auto)]
[MarshalAs (UnmanagedType.ByValStr,SizeConst=(int)16)]
public string szIpAddress;
[MarshalAs (UnmanagedType.ByValStr,SizeConst=(int)16)]
public string szServerIpAddress;
// In the calling function
ipstatus = Ras.RasGetProjection(this._Handle,RASPROJECTION.RASP_PppIp,pppip,ref size);
|
|
|
|
|
hey people,
I need some idea on creating a web part on sharepoint.
I need a web part that could add user both on Active Directory and on the SharePoint site, all at the same page. This is to remove the hassle of creating separate users (on separate processes, of course) on my Active Directory Service and on Windows SharePoint Services.
Any suggestions would really be helpful, or if somebody already has it, please tell me
Thanks and good day
|
|
|
|
|
How to get the 'columnname' of a chosen cell in a grid...my grid's columnnames are the dates and i want to get that specific date whenever i clicked on a certain cell...i need this badly...please help me...thanks!
|
|
|
|
|
Very simple problem. You should have googled first. Here is a wonderful link for the DataGrid: www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp[^]
Please delete the other thread you started if you have a double post.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi
have a look here.it should be something what you look for
www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp#xx953344xx
Huseyin
|
|
|
|
|
How to get the 'columnname' of a chosen cell in a grid...my grid's columnnames are the dates and i want to get that specific date whenever i clicked on a certain cell...i need this badly...please help me...thanks!
|
|
|
|
|
I am developing an MDI vector drawing appliction and have, after trying to implement a auto-scroll bar, found that it now draws in the main MDI container. How can I limit the drawing to the active child form?
Andy
|
|
|
|