|
Check if any of their documentation can help you out.
|
|
|
|
|
Hi,
I have a Windows 8 App , which calls to Twitter via Azure Mobile Service. Intially I was able to get the user's json information ( Name and Profile picture ) by passsing the ID to the following URL:
https://api.twitter.com/users/
However with the change of twitter API 1.1 this doesnot work. I am able to login but unable to retreive the user information in JSON format.
Please help me getting the correct signature in C# in the following format.
https://api.twitter.com/........................................................
I have the following data with me:
User ID
oauth Token
Consumer Key
Consumer Secret
I would need the output in a URL format which when I put in my browser returns the user information in JSON format. I tried refering https://dev.twitter.com/docs/auth/creating-signature but I am unable to get it in URL format.
Your help will be highly appreciated.
|
|
|
|
|
This is not a C# question; you should be asking this at the Twitter developer site.
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
I am trying understand for what is IServiceProvider. I readed some basic information about that by I dont have idea for what is it good and usefull.
Does someone know some easy example for understand of that?
Thank you very much
|
|
|
|
|
Its typically used by design-time code to get designer services, like the IComponentChanged service or the IWindowsFormsEditorService. Basically it provides an interface for an object to obtain services from another part of the application.
The only time you (almost always) use this is during development of design-time rich controls. For example if you want to add custom property designers to the property grid, you would create a UITypeEditor for your property and override some of the methods, as in this example[^].
|
|
|
|
|
I tried to capture webcam video into a mp4 file using the following code.
void preview(int deviceNo, string filename)
{
try
{
capture = new Capture(filters.VideoInputDevices[deviceNo], filters.AudioInputDevices[0]);
//capture.FrameSize = new Size(320, 240);
//capture.FrameRate = 30;
//capture.VideoCompressor = filters.VideoCompressors[0];
//capture.AudioCompressor = filters.AudioCompressors[0];
capture.FrameRate = 29.997; // NTSC
capture.FrameSize = new Size( 320, 240 ); // 640x480
capture.AudioSamplingRate = 44100; // 44.1 kHz
//capture.AudioSampleSize = 16; // 16-bit
//capture.AudioChannels = 1; // Mono
// capture.Filename = "C:\MyVideo.avi";
capture.PreviewWindow = panel1;
if (btnStartVideoCapture.Text == "STOP")
{
counter++;
if (!capture.Cued) capture.Filename = filename + ".mp4";
capture.Cue();
}
capture.Start();
panel1.Visible = false;
}
catch {}
}
/*============================================================================*/
private void btnStartVideoCapture_Click(object sender, EventArgs e)
{
startOrStopCapturing(capture,filename);
}
/*============================================================================*/
void startOrStopCapturing(Capture capture, string filename)
{
btnStartVideoCapture.Visible = false;
if (capture != null) capture.Stop();
if (timer.Enabled) timer.Stop();
if (btnStartVideoCapture.Text == "START")
{
btnStartVideoCapture.Text = "STOP";
btnStartVideoCapture.BackColor = Color.Maroon;
panel1.Visible = true;
try
{
if (!capture.Cued) capture.Filename = filename + ".mp4";
capture.Cue();
capture.Start();
timer.Start();
}
catch (Exception ex)
{
MessageBox.Show("Error Message: \n\n" + ex.Message);
}
}
else
{
btnStartVideoCapture.Text = "START";
btnStartVideoCapture.BackColor = Color.DarkSlateBlue;
panel1.Visible = false;
}
btnStartVideoCapture.Visible = true;
}
although the file is saved as mp4, but android still cannot play it. When I open meta info of the file, it is still an avi format file. Does anyone know how to save it as a mp4 file?
Here is the info of the file save as mp4 extension but has avi format
General
Complete name : C:\Recorder\bin\Debug\test.mp4
Format : AVI
Format/Info : Audio Video Interleave
File size : 2.62 MiB
Duration : 9s 72ms
Overall bit rate : 2 422 Kbps
Video
ID : 0
Format : Cinepack
Codec ID : cvid
Duration : 7s 533ms
Bit rate : 1 889 Kbps
Width : 320 pixels
Height : 240 pixels
Display aspect ratio : 4:3
Frame rate : 30.000 fps
Bits/(Pixel*Frame) : 0.820
Stream size : 1.70 MiB (65%)
Audio
ID : 1
Format : ADPCM
Format profile : A-Law
Codec ID : 6
Codec ID/Hint : CCITT
Duration : 9s 72ms
Bit rate mode : Constant
Bit rate : 705.6 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 8 bits
Stream size : 781 KiB (29%)
Interleave, duration : 204 ms (6.11 video frames)
Interleave, preload duration : 500 ms
Thanks,
Peter
|
|
|
|
|
Just replacing an extension of a file does not at all cause a format conversion.
Why did you comment those lines out:
I do not know where exactly you have to set the format you want to get instead of the default format, but that looks like a good place.
|
|
|
|
|
Hi,
I have a word file with a specific format, i want to insert name,address and some other values into that format.
Can i do that using c# ? if yes, how ??
Please suggest a solution
Thanks
|
|
|
|
|
There are many resources here on CodeProject for inter-operating with Microsoft Word. Just search for terms like "Word Automation," "Microsoft Word," etc.
You could make your question much more specific, and describe what you've done so far.
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
I suggest you put bookmarks in the source document and then insert the text into the relevant bookmarks
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Well, Could you tell me your specific word file format? Without that, nobody can insert it.
|
|
|
|
|
Hi,
Its some contract agreement with the header , picture and some other agreement details. I need to fill the Customer Name, Date and address from the database.
I already tried the find and replace codes, but since that document has to be reused , finding and replacing text wont solve the problem.
Is there any way i can create an object from one existing document and save it in another name with the replaced texts ?
|
|
|
|
|
Sandeepdshenoy wrote: Is there any way i can create an object from one existing document and save it in another name with the replaced texts ?
Use File.Copy.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
This is what i have done till now...
var myWord = new Microsoft.Office.Interop.Word.Application();
var myDoc = new Microsoft.Office.Interop.Word.Document();
object missing = System.Type.Missing;
try
{
object FileName = @"D:\Declaration.docx";
myDoc = myWord.Documents.Open(ref FileName,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing);
myDoc.Activate();
foreach (Microsoft.Office.Interop.Word.Range tempRange in myDoc.StoryRanges)
{
tempRange.Find.Text = "@DonorName";
tempRange.Find.Replacement.Text = "Sandeep D Shenoy";
object replaceAll = Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll;
tempRange.Find.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
tempRange.Find.Execute(ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref replaceAll,
ref missing, ref missing, ref missing, ref missing);
tempRange.Find.Text = "@Date";
tempRange.Find.Replacement.Text = "01-01-2013";
tempRange.Find.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
tempRange.Find.Execute(ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref replaceAll,
ref missing, ref missing, ref missing, ref missing);
tempRange.Find.Text = "@Telephone";
tempRange.Find.Replacement.Text = "1234567890";
tempRange.Find.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
tempRange.Find.Execute(ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref replaceAll,
ref missing, ref missing, ref missing, ref missing);
tempRange.Find.Text = "@Email";
tempRange.Find.Replacement.Text = "abd@gmail.com";
tempRange.Find.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
tempRange.Find.Execute(ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref replaceAll,
ref missing, ref missing, ref missing, ref missing);
}
myDoc.Save();
myDoc.Close(ref missing, ref missing, ref missing);
myWord.Application.Quit(ref missing, ref missing, ref missing);
}
catch (Exception ee)
{
myDoc.Close(ref missing, ref missing, ref missing);
myWord.Application.Quit(ref missing, ref missing, ref missing);
}
I replaced 4 Texts from the document and replaced it with values, but this document has to be reused many times. So is there any way to bypass that ?
|
|
|
|
|
|
Hi ,
I have a windows application developed in dot net 3.5 framework where i am importing and exporting data to excel.I am using Microsoft Office interop excel and have added the version 14.0 as reference to my application. When i run this application on a machine having Office 2007 ( version 12.0) my application does not work. My question is why is it having this issue and why am i getting an exception 14.0 could not loaded
|
|
|
|
|
The interop libraries are different between 12 - and 14, hint that is why they have versions!
There is a reason we NEVER, EVER, under ANY circumstances use Office products in any of our solutions. MS has no compunction breaking systems going forward let alone backwards compatibility.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I though you could include the Dll that will make an Excel file in your solution, so regardless of wheter or not you had Excel install, it would create the file, or?
|
|
|
|
|
To be honest I am not up with the latest Office capabilities - for obvious reasons, I'm assuming you are talking about the Interop files which can be included with the app but I'm dammed sure they are not compatible between versions which is the OPs issue I believe.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
When I went to collage I learned that you should always create a new Excel Object without using Interop, as different Excel versions wouldnt be compatible otherwise, i.a. programming without intellisence. I did some internal programming for a company, and I can tell you that it was a nightmare with just 10 useres... When I found out that one of them had Excel 2003 and the rest had Excel 2005 (or soemthing like that) I just included the dll, the Library 12, and It all worked as expected. However I would never recomend doing this on a massive scale...
|
|
|
|
|
which office version i should add to C# application as reference to work with excel 2007 and higher keeping the excel 2007 to be installed as prerequisite to run the application.
|
|
|
|
|
In my experience (which is not perfect in this area) I would target the 2007 version of Excel, add this version as a DLL resource that follows the exe file you produce. That way it should be able to write files that are compatible with any newer excel file, however you might have a problem in reading newer excel files this way....
|
|
|
|
|
Create a Primary Interop Assembly (PIA) with an old version of Excel (2007 or older), and use that for your coding. Newer version are normally backwards compatible. I use a PIA generated with Office XP, and do not encounter problems with Office 2010.
|
|
|
|
|
Not claiming any expertise on this, but instead of:
Microsoft.Office.Interop.Excel.Application app = new Excel.Application();
you may want to try this code sequence. I believe this will find the relevant info from the system for the installed PIA's and create the appropriate instance.
Type ExcelType = System.Type.GetTypeFromProgID("Excel.Application");
Microsoft.Office.Interop.Excel.Application app;
app = (Microsoft.Office.Interop.Excel.Application)System.Activator.CreateInstance(ExcelType);
I think this is the method [^]Kenneth described.
|
|
|
|
|
Hi,
I need to build a system that detects the availability of the parking space for 2/4 wheelers.
I will not be using the RFID to detect the availibity though.
The points that I have in my mind are :
1.The pressure sensors (or any other sensor) to be installed on the parking place.
2.The space will show green when no car is park on the monitor installed at the entry of the parking
3.As soon as the car gets parked on the space, the area will be marked as red on the screen which means the space is no more vacant.
The purpose of the system will be to save time looking out for the parking spaces and wasting precious fuel
Hope I get some help here
Regards
Ashu
|
|
|
|
|