16,004,833 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by bunty swapnil (Top 35 by date)
bunty swapnil
21-Jul-14 7:50am
View
Hi Vathsala,
From where will get thi sharepoint.client dll?
and the function copystream?
bunty swapnil
18-Jul-14 6:08am
View
Could you please tell me the steps followed by you for completing this job.
like where we have to write this code.
i mean steps because i am very new to ssis.
bunty swapnil
30-Jun-14 2:31am
View
sharepoint this is an internet url. some excel files posted by people on daily basis and i want to download those file from that url.
bunty swapnil
17-Jun-14 6:12am
View
Hi,
MYTextbox.focus is ok but i wanted to do using MVVM pattern not using code behind.
suppose if i clicked on button and because of some validation in textbox we are unable to retrive.
so for knowing the reason the perticular textbox should be focused and tell because of this error we are unable to redirct.
Thanks for your response
i would like to hear from your side.
bunty swapnil
13-Jun-14 10:13am
View
Will it work. i dont have visual studio but i am confirmed this code will not work.
bunty swapnil
14-Apr-14 0:38am
View
Thanks a lot and i am getting the location name and Time with respect to UTC. so will convert it.
Thank you so much you rock!! :)
Thanks all for guiding me.
bunty swapnil
13-Apr-14 4:45am
View
thanks i got the location name by changes i made by passing timezone object from the code and passed into timzoneinfo.gettimezonebid() method.
I am getting in terms UTC+6:00, But i need date and time current format. tell me what to do plz
bunty swapnil
12-Apr-14 12:13pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RestSharp;
using System.Xml;
using System.IO;
namespace LocationTimeZone
{
class Program
{
const string GOOGLE_API = "https://maps.googleapis.com";
const string GOOGLE_TIMEZONE_REQUEST =
"maps/api/timezone/xml";
// Pensacola, FL
const double LATITUDE = 27.172079;
const double LONGITUDE = 78.036618;
// ****************************************************** Main
static void Main(string[] args)
{
string time_zone = String.Empty;
time_zone = get_time_zone(LATITUDE,
LONGITUDE,
DateTime.Now);
//this will take timezone object i.e timezone id to give the current date time
DateTime timeUtc = DateTime.Now;
string s = time_zone;
TimeZoneInfo cstZone = TimeZoneInfo.FromSerializedString(time_zone);// issue is here when debug says null in the timezone object
DateTime cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone);
Console.WriteLine("Current date time of the given timezone -received from latitude and longitude" + cstZone);
Console.WriteLine("Timezone" + time_zone);
Console.Write("Press any key to exit");
Console.ReadKey();
}
// ********************************************* get_time_zone
static string get_time_zone(double latitude,
double longitude,
DateTime date)
{
RestClient client;
string location;
RestRequest request;
RestResponse response;
TimeSpan time_since_midnight_1970;
double time_stamp;
string time_zone = "In error";
try
{
client = new RestClient(GOOGLE_API);
request = new RestRequest(GOOGLE_TIMEZONE_REQUEST,
Method.GET);
location = String.Format("{0},{1}",
latitude,
longitude);
time_since_midnight_1970 = date.Subtract(
new DateTime(1970, 1, 1, 0, 0, 0));
time_stamp = time_since_midnight_1970.TotalSeconds;
request.AddParameter("location", location);
request.AddParameter("timestamp", time_stamp);
request.AddParameter("sensor", "false");
response = (RestResponse)client.Execute(
request);
if (response.StatusDescription.Equals("OK"))
{
XmlNode node;
XmlDocument xml_document = new XmlDocument();
xml_document.LoadXml(response.Content);
node = xml_document.SelectSingleNode(
"/TimeZoneResponse/time_zone_name");
if (node != null)
{
time_zone = node.InnerText;
}
}
}
catch (Exception ex)
{
time_zone = "In error";
}
return (time_zone);
}
}
}
the issue with this not able to take timezone object that has timezone id to get current date time and also not able to get location name on basis of this.PLZ help me regarding this.
bunty swapnil
12-Apr-14 8:29am
View
i looked into the link thanks it was useful but my scenario is where i need to get the location name,date time from latitude and longitude using console c#.net. From the above code i am able to get the timezone how shall i use to convert to the current date time as well as location name.
Plz guide me.
bunty swapnil
12-Apr-14 3:20am
View
Thanks All for replying and apart form google api /using RestSharp interface for google api, is there any inbuild packages or classes in .net or use any Microsoft dll or something in .net where i can use for getting location name,Current Timezone using latitude and longitude.
bunty swapnil
12-Apr-14 3:16am
View
Thanks For Replying. @gggustafson, you are awesome and the code helped me a lot
Really you guys rock!. one more help can i use the same api to get the location name as well throught latitude and longitude.
bunty swapnil
11-Apr-14 10:03am
View
public DateTime GetLocalDateTime(double latitude, double longitude, DateTime date)
{
var client = new RestClient("https://maps.googleapis.com");
var request = new RestRequest("maps/api/timezone/json", Method.GET);
request.AddParameter("location", latitude + "," + longitude);
request.AddParameter("timestamp", date.ToTimestamp());
request.AddParameter("sensor", "false");
var response = client.Execute<googletimezone>(request);
return date.AddSeconds(response.Data.rawOffset + response.Data.dstOffset);
}
in code behind i have written this code and there is no reference or namespace for rest client class. i herd there is REstSharp library for .net in github but did not help me out to go further. mainly i need the timezone and location name based on latitude and longitude, but here if i use this code with some library do u think i will get what i have mentioned
bunty swapnil
24-Feb-14 1:21am
View
i have two classes in one class i am writing popup message according to conditions i wrote in first class but it is coming after execution of method then will switch into other class. but i dont want to go ahead if first condition is unchecked. and want to show pop up i wrote in 2nd class.
bunty swapnil
12-Feb-14 1:17am
View
In this case Getting time -09:00:00 it should be 09:00:00.
bunty swapnil
11-Feb-14 2:01am
View
Hi Prasad ,
i am working on windows form not on wpf.
bunty swapnil
14-Dec-13 4:48am
View
if writing in this type getting error coudnt find this path.
bunty swapnil
11-Dec-13 4:48am
View
yes tadit but i tried above code that is also not working.
bunty swapnil
7-Dec-13 3:29am
View
i have passed the image path in xml
<image href ="Pathoffile"/>
each root node have this tag.
i want to read all image and display using wpf
bunty swapnil
3-Dec-13 23:17pm
View
all i am new to xml and mvvm model.
bunty swapnil
3-Dec-13 9:13am
View
I want to bind all the feature of xml into the list view control.
using mvvm pattern i have to read xml file and make list of available feature into xml file.
then this method want to bind with item source property of list view control.
bunty swapnil
29-Nov-13 2:19am
View
yes every time i am calling this function because if i will read string as a character the character array size will be the length of string but using stringtobytearray will get array half of length of string. i makes pairs of 2 char like B8 = 184,0c = 12.
in byte array values is coming in ASCII format so i want to convert byte array of ASCII values into Byte array of hex value.
And condition is
We should get equal size of ASCII value byte array and hex value byte array.
bunty swapnil
21-Nov-13 0:06am
View
I class i inherit form 1.
class1: form1
then imagedetailsstructure is coming. and when i am writing IHS.Imagesize value is not coming.
i am getting 0.
bunty swapnil
20-Nov-13 7:46am
View
i have made struct ABC in form1 code behind.
and i this i have two variable
uint32 imagesize;
uint32 versionnumber;
i will assign values for this struct in method imageheader().
openDialogueBox();
using (StreamReader sr = new StreamReader(path))
{
string ReadImageData = sr.ReadToEnd();
byte[] readImageDataIntoBytes = StringToByteArray(ReadImageData);
calculateDataLength = Convert.ToUInt32(readImageDataIntoBytes.Length);
}
IHS.LoadImagesize = calculateDataLength - 16;
IHS.versionNum = 0x00ff0f;
here IHS is object of struct.
when i am passing this structure into class. value is 0 i am getting but i want the value that assigned in IHS.Loadimagesize.
bunty swapnil
19-Nov-13 10:19am
View
i wrote Buffer.BlockCopy(source, 66680, byteSection, 0, byteSection.Length)
its not woking. byte section. this size and index will change.
for example i have byte array of 10 and i destination array i want to read from 4th to 9th.
can you clear the above code.
bunty swapnil
19-Nov-13 8:28am
View
i file i want to read in two parts.
and in my scenario file is already opened.i can not open it again. so i read only through stream reader. and then using readtoend store bi file in a string. after that through string to byte array make a pair of 2 char and convert it into bytes.
so i have byte array readalltextofdataintobytes. and if i will change my code i have to change more functionality.
even i use this code also.
array.copy(readalltextdataintobytes,internalbuffer,10478);
but giving eror value can not be null.
bunty swapnil
19-Nov-13 3:57am
View
Maybe you will need to change your current design.
Apologies: somehow I edited your response, rather than adding my own comment.
I'm surprised; I didn't think CP allowed me to do that !
bunty swapnil
19-Nov-13 1:30am
View
i am not able to put my code here because is too lengthy. i need only help from any example.
bunty swapnil
19-Nov-13 1:29am
View
yes i am working on Intel hex file. and from hex file reading only data parts. and generating one bin file. from bin file i want read string for 1 KB data. and always want to check with internal memory addresses and from external memory addresses.
and at one condition in internal memory will not have 1 KB data. So i have to read only only remaining data and then same will do with external memory.
bunty swapnil
19-Nov-13 1:03am
View
this string is only example. i made bin file from hex file in that i have addressing.
internal memory start address and internal memory end address. same with external memory.
and i want to send 1 KB data each time means i read string from 0 to 2048 and then convert into byte array. so byte array size will be 1024. and at one condition i don't have 1 KB data in internal memory so i want to read only remaining data.
bunty swapnil
18-Nov-13 3:59am
View
yes
bunty swapnil
18-Nov-13 3:57am
View
yes command was uint32 but i am not able to convert from uint32 to char array so i made string i.e that command mentioned in double quotes.
bunty swapnil
9-Nov-13 0:48am
View
i have a byte array of 1024 size.
byte[] datablock_appenddataIntoByte = StringToByteArray(datablock_appenddata);
and datablock_appenddata contains string of hex numbers.
and hexnumbers like:-B80C001061020000690200006B020000
i want to calculate check sum through crc-32.
bunty swapnil
9-Nov-13 0:28am
View
Hi Andreas
i am doing work on Intel hex file.http://www.dlwrr.com/electronics/tools/hexview/hexview.html
and i want to calculate check sum through crc-32 calculator.for each data block.
i am reading only data part of each line. so i have to calculate 1 KB data. and check sum of that 1 KB data.
so please suggest me something which can help me.
bunty swapnil
8-Nov-13 6:51am
View
cpallini
can you help me to calculate check sum for this byte array.
bunty swapnil
8-Nov-13 6:16am
View
can u write code for addition.
byte[] datablock_appenddataIntoByte = StringToByteArray(datablock_appenddata);
this byte array contains 1024 bytes from 0-1023. i want to add all.
Show More