|
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
|
|
|
|
|
Hi,
Please tell me whether all dates except all mondays can be disabled in Date Time Picker control or not. If yes then how?
Thanks in Advance.
Manoj
|
|
|
|
|
No simple way of doing this unless you subclasses the control. Even then I haven't looked into it but I know that its going to be messy.
You can try to solve your problem by validating the input and ignoring the dates that you want to throw out. If that doesn't work it will be much easier to find an alternative control.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
hi, i've got this window form. i need to pass this value string d into another class to do some dbconnection..
<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
<br />
public string d = "20"; <br />
.<br />
.<br />
.<br />
.<br />
<br />
private void testing()<br />
{<br />
<br />
dbConnection dbcon = new dbConnection();<br />
dbcon.Connection()<br />
<br />
}<br />
}
<br />
public class dbConnection <br />
{<br />
public OleDbConnection conn;<br />
public string SQL ; <br />
public OleDbCommand cmd;<br />
public OleDbDataAdapter adpt; <br />
public DataSet ds; <br />
<br />
public dbConnection()<br />
{<br />
<br />
conn = new System.Data.OleDb.OleDbConnection();<br />
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +<br />
"Data source = "+Application.StartupPath +@"\db.mdb";<br />
<br />
}<br />
<br />
public void Connection()<br />
{<br />
<br />
Form1 ccF = new Form1();<br />
<br />
SQL = "SELECT * FROM Table WHERE ID <='" + (ccF.d) + "'"; <br />
cmd = new System.Data.OleDb.OleDbCommand (SQL, conn);<br />
adpt = new System.Data.OleDb.OleDbDataAdapter(cmd); <br />
ds = new System.Data.DataSet(); <br />
adpt.Fill(ds,"Table ");<br />
<br />
}<br />
<br />
}
my problem is that it can't read ccF.d.. sorry im kinda bad in using class..
Chris
|
|
|
|
|
What do you mean exactly by "read ccF"? What do you want to read and where?
www.troschuetz.de
|
|
|
|
|
First check that u have called ur testing function at some point in ur Form1.
Second I tried ur code and it works for me as far as reading ccF.d is concerned.
So i guess there is come problem in the way ur accessing it.
My working code of Form 1 is as under
public class Form1 : System.Windows.Forms.Form
{
public string d = "HI";
private void Form1_Load(object sender, System.EventArgs e)
{
testing();
}
private void testing()
{
dbConnection dbcon = new dbConnection();
MessageBox.Show(dbcon.Connection());
}
}
public class dbConnection
{
public string SQl;
public string Connection()
{
Form1 ccF = new Form1();
return SQl = ccF.d;
}
}
Ketty
|
|
|
|
|
How can i send my new exe file to other client machine's from the
Server.(without go and copy individualy).
I would like to develop a application in c#.can any one help me to start
this application.
Thanks
Amal
|
|
|
|
|
Assuming that you own all the client computers, and assuming that your computers are >= windows 2k (less problems)...
- Create an MSI install package.
- Use Group Policies to deploy the package.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
When the UpdateCommand or DeleteCommand method of the SqlDataAdapter object uses a SQL Server stored procedure that raises an error,the ADO.NET client
application may not trap the error raised by SQL Server.
Microsoft Says use SqlDataReader in KB Q811482. Why they will not fixed this problem ?
|
|
|
|
|
.... Ask Microsoft! ....
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to add an item programmatically?
e.g If I want to add an existing .resx file to the current project how can it be done?
|
|
|
|
|
you want to know for windows forms or ASPX pages. Plz Specify.
Ketty
|
|
|
|
|
Does anyone know how to make use of a c# variable in html.
In my C# code i have a variable EmbedTextBox.Text = this.OpenFileDialog;
I want to use that same variable's contents in my HTML code e.g.
<html><value=mms://server/EmbedTextBox.Text></html>
which does not work.
is there an easy of doing this?
|
|
|
|
|
That makes no sense. What are you trying to achieve? (at a higher level than putting a variable on an HTML page)
Do you want to know more?
|
|
|
|
|
I'm not very nowledgeable about ASP.NET, but maybe the following can help you or at least get you on the right way.
You can use the Page.Response property to influence the HTTP response data that will be send back to the client. The returned object provides for example a Write method that allows you to write information to the HTTP output content stream.
www.troschuetz.de
|
|
|
|
|
were can i find a recorded note(s) like a b c d e f or g. i can't seem to find it any where thx :P
IM PROUD TO BE A GMAIL;
|
|
|
|
|
It's called "sheet music" and you find it at music stores...
What does this have to do with the C# language?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
no im not talking about music, im talking about a single note like the note a, just a like a sec. playing of it... Im doing a project on neural network composition in c#(I'm pretty new to it since i use c++ all the time but now im hooked, mostly since it's alot more easier :P)
IM PROUD TO BE A GMAIL;
|
|
|
|