|
Do you mean C, or C# ? What code are you trying and what problems do you have ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
my application is to use web for making pstn calls.i m using asp.net with c # for this application. where user can use this web application for making calls throug website. but unfortunatlly i m not succeded yet. and now i decided to take your help.
i have some problem in finding the best api for voip to use it in my application to make pstn calls. i have tried two to three api but when i use it i could not manage to call with it. although the status of some api show dialing but actully it does not call the phone.
i tried for 1 week trying different api but could not succeded.
my location is pakistan and the server where upload it and try is in canada.
may be i m not able to configure it correctlly.
can any body help me how can i do this. if you can provide a link of tutorial or any helping matterial
thanx in advace for help.
amirzada
|
|
|
|
|
It's kind of difficult to tell what's wrong just by reading the info you provided.. And your odds of getting help is probably better in the ASP forum.
|
|
|
|
|
i need the help as a biggner. if you know any thing helpfull please provide
amirzada
|
|
|
|
|
aamirzada wrote: if you know any thing helpfull please provide
Here's about the best advice I can give you.... ready...
DONT TAKE ON PAID WORK FOR WHICH YOU DO NOT HAVE THE REQUIRED SKILLS TO COMPLETE.
|
|
|
|
|
thanx for your advise but i did not take it is given to me from the university.
thanx for ur coopration.
amirzada
|
|
|
|
|
aamirzada wrote: my location is pakistan and the server where upload it and try is in canada.
*sigh* one more canadian out of work then ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi
using c#.net i want to detect whether there is any javascript code present on the webpage for google adsense.
please tell me about the javascript code for the google adsense
Thanks
Anil Veeraghattapu ...
|
|
|
|
|
If you want to have a look at what the javascript looks like, you've got two options
1) Find a site that uses google adsense and view it's source (search for google_ad_client in the source)
2) Sign up for a adsense account, and request the javascript snippet yourself
As I say in (1) searching for "google_ad_client" within a script tag should probably be enough
|
|
|
|
|
Hi benjymous
Thanks for your reply
well i am also thinking about your 1st option
so are you sure if a website is running google ad sense then it should contain the keywords like "google_ad_client" ?????
Thanks
Anil Veeraghattapu.
|
|
|
|
|
Well, their javascript block has been formatted like that for a good few years, so if they changed it, it'd probably break all the sites using adsense, so it's a fairly safe assumption that it won't change, but it's never guaranteed!
|
|
|
|
|
Hi,
How to define an inline array size inside the stucture.Sample code i'm attaching the code block.
I'm using MarshalAs unmanaged it's working fine.
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=8, ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]
public byte[] array123;}
And i used a struct which has a create method that fills out the array but it thow an error
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
public byte[] array123;
public static tPacket Create() {
return new tPacket() { array123 = new byte[8] }; }}
please help me.
With Regards
Mahesh
|
|
|
|
|
Hi,
some comments/questions:
1.
if you get an exception, you should provide all the information about it.
2.
with a using System.Runtime.InteropServices; statement at the top, you don't need to fully qualify all the Marshal attributes.
3.
why do you define your struct twice? and differently?
4.
most often a struct gets a constructor, taking some parameters, and initializing all members. So you don't really need a Create() method.
5.
your code, and several variations on it, work for me. as in:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst=8, ArraySubType=UnmanagedType.I1)]
public byte[] array123;
public static tPacket Create() {
return new tPacket() { array123 = new byte[8] };
}
}
...
tPacket p=tPacket.Create();
for (byte i=0; i<8; i++) p.array123[i]=i;
6.
For readability code needs indentation. And PRE tags tend to preserve such formatting.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
Thank you for our reply.
Actually i don't use the MarshalAs attribute to declare the array size in the structure.
And i want to read the 48 byte of data from the file.
and allocate the 48 byte of data into my structure.
the structure member break off will be
UInt16
UInt16
Byte[3] ==>3 Byte data-->This is my array to hold the 3 byte of data
Byte[3] ==>3 Byte date-->This is my array to hold the 3 byte of data
UInt16
UInt16
1 Byte
UInt32[8]==>32 Byte data-->this is my array to hold the 32 byte of data
1 Byte
But at once shot i want to copy my structure.
for the i used Marshl
But now i'm not to use the marshal
i have to use the BitConverter Class
using that how to copy my struture.
With Regards
Mahesh
|
|
|
|
|
Hi,
1.
without Marshal attributes any array embedded in a class or struct will be a reference, not the actual data (so it takes 4 or 8 bytes for Win32/Win64); so you need ByValArray and SizeConst .
2.
Your Int32 array is badly aligned; when a data item isn't naturally aligned, there will be a performance hit. If you can freely choose the struct layout I recommend:
- either to move the largest types first (longs, ints, shorts, bytes)
- or to explicitly add padding bytes so each element aligns on its natural boundary (i.e. each int is at an offset that is a multiple of 4).
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
Is it possible copy by using BitConverter class
With Regards
Mahesh
|
|
|
|
|
No.
BitConverter converts predefined value types (boolean, char, int, double, ...) to/from bytes or another predefined value type, as should be clear from the documentation. It does not handle user-defined structs nor arrays.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
i have created text to image conversion.
i need image to hexa format???
bez of i want to sent serial port in hexa format.
please anyone help me ....
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Why? The hexadecimal formatted string would get sent through the serial port as bytes anyway. You might find it simpler to Save the Bitmap to a MemoryStream, then writing the raw bytes to the SerialPort instead. To convert the MemoryStream to a Byte array, use the ToArray method.
|
|
|
|
|
thnx for reply...
give me some example..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
No. I wouldn't be doing you any favours if I sent you the code. The code for converting an image to a byte array is publicly available, as is the SerialPort class.
|
|
|
|
|
Dear All, I have following Query in Acces. I am trying to alter this query. How can i write the alter Statement for this query using c#?
PARAMETERS comId Guid, subprojId Guid;
SELECT Community.CommunityID, Community.CommunityCode, Subproject.SubprojectID, Subproject.SubprojectCode, IIf(Subproject.SubprojectStatusID In (1,2,4),Subproject.PlannedNSPBudgetAFA,IIf(Subproject.SubprojectStatusID In (3,5,6),Subproject.ActualNSPBudgetAFA,0)) AS TotalSubProjectBudget, zSubprojectStatus.SubprojectStatus, Subproject.SubprojectStatusID, Subproject.PlannedCDCBudgetAFA, Subproject.PlannedStartDate, Subproject.PlannedEndDate, Subproject.DateForm7Filled, Subproject.ActualNSPBudgetAFA, Subproject.ActualCDCBudgetAFA, Subproject.ActualStartDate, Subproject.ActualEndDate, Subproject.PMUSFSRApprovalDate, Subproject.ActualSkilledLabors, Subproject.ActualUnSkilledLabors, Subproject.SubprojectCompletionReason, Community.BGEntitlementAFA, Subproject.PlannedNSPBudgetAFA, vw_getPaidInstallments.PaidActualNSPAmountAFA AS PaidInstallmentAFA, IIf(IsNull([vw_getRemainingCDCBudget].[RBGE]),[BGEntitlementAFA],[vw_getRemainingCDCBudget.RBGE]) AS RemainingBG
FROM (Community INNER JOIN vw_getRemainingCDCBudget ON Community.CommunityID = vw_getRemainingCDCBudget.CommunityID) INNER JOIN ((Subproject INNER JOIN zSubprojectStatus ON Subproject.SubprojectStatusID = zSubprojectStatus.SubprojectStatusID) LEFT JOIN vw_getPaidInstallments ON Subproject.SubprojectID = vw_getPaidInstallments.SubprojectID) ON Community.CommunityID = Subproject.CommunityID
WHERE (((Community.CommunityID)=[comId]) AND ((Subproject.SubprojectID)=[subprojId]) AND ((Subproject.SubprojectStatusID) In (1,2,3,4)));
would appreciate only the alter statement to update this query.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Solved!!!
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
I have create a property of System.object return type
I want to change its Type at runtime according to my need.
for example I want to convert it into System.String or System.Enum.
is it possible ?
Thanks.
|
|
|
|
|
You can write a generic method, I'm not sure if you can write one where the generic type specifies the return type, but I expect so. Or you can cast your object to whatever you like, but the real kicker is, how do you get the method to return objects of different types all the time ? Generics will do that, but how do you define the instance of the object to have the value you want, if it could be any type of object ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|